-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
22 additions
and
13 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,15 +1,22 @@ | ||
FROM python:3.11 | ||
FROM python:3.11 AS deps | ||
WORKDIR /tmp | ||
RUN mkdir /deps | ||
ADD requirements.txt ./ | ||
RUN pip install -U pip setuptools wheel && \ | ||
pip wheel -r requirements.txt --no-cache-dir --wheel-dir /deps && \ | ||
rm -f /deps/setuptools-*.whl | ||
|
||
FROM python:3.11-slim | ||
WORKDIR /usr/src/app | ||
COPY requirements.txt /usr/src/app/ | ||
RUN groupadd -g 998 -r kompassi && useradd -r -g kompassi -u 998 kompassi && \ | ||
pip install -U pip setuptools wheel && \ | ||
pip install --no-cache-dir -r requirements.txt | ||
COPY . /usr/src/app | ||
RUN groupadd -g 998 -r kompassi && useradd -r -g kompassi -u 998 kompassi && apt-get update && apt-get -y install libpq5 && rm -rf /var/lib/apt/lists | ||
ADD requirements.txt ./ | ||
RUN --mount=type=bind,from=deps,source=/deps,target=/deps \ | ||
pip install --no-cache-dir --no-index --find-links /deps /deps/*.whl | ||
ADD . . | ||
RUN env DEBUG=1 python manage.py collectstatic --noinput && \ | ||
env DEBUG=1 python manage.py kompassi_i18n -ac && \ | ||
python -m compileall -q . && \ | ||
chmod 755 manage.py scripts/*.sh | ||
USER kompassi | ||
EXPOSE 8000 | ||
ENTRYPOINT ["/usr/src/app/scripts/docker-entrypoint.sh"] | ||
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"] |
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