-
Notifications
You must be signed in to change notification settings - Fork 291
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(core): running testcontainer inside container (#714)
closes #475 One step closer to solve #517 Replaces #622 According to the [data collected](#475 (comment)) this should fix issues running testcontainers inside a container in almost all cases. There is still an issue when running it within docker desktop, that is probably easily solved which checking for the existence of `host.docker.internal`. But I have to recollect the data to ensure this, so this will be added at later point in time, as with with setting `-e TESTCONTAINERS_HOST_OVERRIDE=host.docker.internal` an easy workaround exists as well.
- Loading branch information
Showing
16 changed files
with
639 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,29 @@ | ||
ARG PYTHON_VERSION | ||
FROM python:${version}-slim-bookworm | ||
ARG PYTHON_VERSION=3.10 | ||
FROM python:${PYTHON_VERSION}-slim-bookworm | ||
|
||
ENV POETRY_NO_INTERACTION=1 \ | ||
POETRY_VIRTUALENVS_IN_PROJECT=1 \ | ||
POETRY_VIRTUALENVS_CREATE=1 \ | ||
POETRY_CACHE_DIR=/tmp/poetry_cache | ||
|
||
WORKDIR /workspace | ||
RUN pip install --upgrade pip \ | ||
&& apt-get update \ | ||
&& apt-get install -y \ | ||
freetds-dev \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
&& apt-get install -y freetds-dev \ | ||
&& apt-get install -y make \ | ||
# no real need for keeping this image small at the moment | ||
&& :; # rm -rf /var/lib/apt/lists/* | ||
|
||
# install poetry | ||
RUN bash -c 'python -m venv /opt/poetry-venv && source $_/bin/activate && pip install poetry && ln -s $(which poetry) /usr/bin' | ||
|
||
# install requirements we exported from poetry | ||
COPY build/requirements.txt requirements.txt | ||
RUN pip install -r requirements.txt | ||
# install dependencies with poetry | ||
COPY pyproject.toml . | ||
COPY poetry.lock . | ||
RUN poetry install --all-extras --with dev --no-root | ||
|
||
# copy project source | ||
COPY . . | ||
|
||
# install project with poetry | ||
RUN poetry install --all-extras --with dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.