mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-04-11 04:14:21 +03:00
Lockfile & single stage docker image
This commit is contained in:
parent
fb837142ee
commit
d1b92548a6
|
@ -13,7 +13,9 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
|
|||
# dependencies for building Python packages
|
||||
build-essential \
|
||||
# psycopg dependencies
|
||||
libpq-dev
|
||||
libpq-dev \
|
||||
gettext \
|
||||
wait-for-it
|
||||
|
||||
# Requirements are installed here to ensure they will be cached.
|
||||
RUN --mount=type=cache,target=/root/.cache/uv \
|
||||
|
@ -26,9 +28,6 @@ ADD . ${APP_HOME}
|
|||
RUN --mount=type=cache,target=/root/.cache/uv \
|
||||
uv sync
|
||||
|
||||
# Python 'run' stage
|
||||
FROM docker.io/python:3.12.7-slim-bookworm AS python-run-stage
|
||||
|
||||
{% if cookiecutter.use_docker == "y" %}
|
||||
# devcontainer dependencies and utils
|
||||
RUN apt-get update && apt-get install --no-install-recommends -y \
|
||||
|
@ -41,25 +40,6 @@ RUN groupadd --gid 1000 dev-user \
|
|||
&& chmod 0440 /etc/sudoers.d/dev-user
|
||||
{% endif %}
|
||||
|
||||
# Install required system dependencies
|
||||
RUN apt-get update && apt-get install --no-install-recommends -y \
|
||||
# psycopg dependencies
|
||||
libpq-dev \
|
||||
wait-for-it \
|
||||
# Translations dependencies
|
||||
gettext \
|
||||
# cleaning up unused files
|
||||
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# All absolute dir copies ignore workdir instruction. All relative dir copies are wrt to the workdir instruction
|
||||
# copy python dependency wheels from python-build-stage
|
||||
COPY --from=python-build-stage --chown=app:app ${APP_HOME} ${APP_HOME}
|
||||
|
||||
ARG APP_HOME=/app
|
||||
|
||||
WORKDIR ${APP_HOME}
|
||||
|
||||
ENV PATH="/${APP_HOME}/.venv/bin:$PATH"
|
||||
|
||||
COPY ./compose/production/django/entrypoint /entrypoint
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user