Skip to content

Commit

Permalink
Remove ubuntu.dev file and use build-args to add layers conditionally
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankApiyo committed Aug 24, 2024
1 parent 6a36d57 commit fe29711
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 107 deletions.
8 changes: 6 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ services:
DJANGO_SETTINGS_MODULE: onadata.settings.docker
build:
context: .
dockerfile: ./docker/onadata-uwsgi/Dockerfile.ubuntu.dev
args:
INSTALL_DEV_DEPENDENCIES: "true"
dockerfile: ./docker/onadata-uwsgi/Dockerfile.ubuntu
depends_on:
- database
- cache
Expand All @@ -22,7 +24,9 @@ services:
DJANGO_SETTINGS_MODULE: onadata.settings.docker
build:
context: .
dockerfile: ./docker/onadata-uwsgi/Dockerfile.ubuntu.dev
args:
INSTALL_DEV_DEPENDENCIES: "true"
dockerfile: ./docker/onadata-uwsgi/Dockerfile.ubuntu
depends_on:
- database
- cache
Expand Down
12 changes: 11 additions & 1 deletion docker/onadata-uwsgi/Dockerfile.ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ RUN chown -R appuser:appuser /home/appuser/.pyenv

USER appuser

ARG INSTALL_DEV_DEPENDENCIES=false
RUN if [ "$INSTALL_DEV_DEPENDENCIES" = "true" ]; then \
git config --global http.version HTTP/1.1 && \
git config --global http.postBuffer 524288000; \
fi

# hadolint ignore=DL3013
RUN python -m pip install --no-cache-dir -U pip && \
python -m pip install --no-cache-dir -r requirements/base.pip && \
Expand All @@ -35,6 +41,10 @@ RUN python -m pip install --no-cache-dir -U pip && \
python -m pip install --no-cache-dir -r requirements/azure.pip && \
python -m pip install --no-cache-dir pyyaml==6.0.1 uwsgitop==0.12 supervisor==4.2.5

RUN if [ "$INSTALL_DEV_DEPENDENCIES" = "true" ]; then \
python -m pip install --no-cache-dir -r requirements/dev.pip; \
fi

FROM base AS docs

ENV PYENV_ROOT="$HOME/.pyenv"
Expand All @@ -53,7 +63,7 @@ RUN python -m pip install --no-cache-dir -r requirements/docs.pip && \
make -C docs html


FROM debian:bookworm-20240722 as runtime
FROM debian:bookworm-20240701 as runtime

ENV DEBIAN_FRONTEND=noninteractive

Expand Down
104 changes: 0 additions & 104 deletions docker/onadata-uwsgi/Dockerfile.ubuntu.dev

This file was deleted.

0 comments on commit fe29711

Please sign in to comment.