Skip to content

Commit 0fab80b

Browse files
committed
Only install Git if it's the dev environment
1 parent 20e303a commit 0fab80b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

config/docker/Dockerfile.web

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,9 @@ RUN set -ex \
2626
# ------------------------------------------------------------
2727
# STAGE 2: Dev layer
2828
# ------------------------------------------------------------
29-
# Details about Microsofts Dev Containers can be found in the following locations:
30-
# * https://hub.docker.com/_/microsoft-devcontainers
31-
# * https://github.com/devcontainers/images
32-
FROM mcr.microsoft.com/devcontainers/python:3.11-bullseye as dev
29+
FROM python:3-slim-bullseye as dev
30+
31+
ARG ENV_NAME=dev
3332

3433
# Set the locale
3534
# libxml2-dev is needed for uwsgi in the production stage
@@ -57,6 +56,9 @@ RUN set -ex \
5756
&& groupadd -r app && useradd --uid=2000 --create-home --home-dir=/home/app --no-log-init -r -g app app \
5857
&& echo "\nsource ./config/bash/bashrc" >> /home/app/.bashrc
5958

59+
# Only install Git if it's the dev environment
60+
RUN if [ "$ENV_NAME" == "dev" ]; then apt-get install git; fi
61+
6062
COPY --from=python-requirements --chown=app:app $VIRTUAL_ENV $VIRTUAL_ENV
6163

6264
USER app

0 commit comments

Comments
 (0)