Skip to content

Commit

Permalink
config(docker): Install devtools if AML_DEBUG is set to true
Browse files Browse the repository at this point in the history
  • Loading branch information
drikusroor committed Feb 5, 2024
1 parent cefbcd8 commit f8d407d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
10 changes: 7 additions & 3 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.8
FROM docker.io/python:3.8
ENV PYTHONUNBUFFERED 1
RUN apt-get -y update
RUN apt-get install -y ffmpeg
Expand All @@ -7,6 +7,10 @@ RUN apt-get install -y gettext
WORKDIR /server
COPY requirements/prod.txt /server/
RUN pip install -r prod.txt
# We add remainig code later, so pip install won't need to rerun if source code changes
COPY . /server/

# Add the dev tools if AML_DEBUG is set to true
ARG AML_DEBUG=false
RUN if [ "$AML_DEBUG" = "true" ] ; then pip install django-debug-toolbar ; fi

# We add remainig code later, so pip install won't need to rerun if source code changes
COPY . /server/
6 changes: 1 addition & 5 deletions backend/DockerfileDevelop
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,4 @@ RUN apt-get install -y ffmpeg

WORKDIR /server
COPY requirements/dev.txt /server/
RUN pip install -r dev.txt

# Base the test image on the base image that is used for development
FROM base as test
COPY . /server/
RUN pip install -r dev.txt
5 changes: 2 additions & 3 deletions docker-compose-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ services:
server:
build:
context: ./backend
dockerfile: DockerfileDevelop
target: test
dockerfile: Dockerfile
depends_on:
db:
condition: service_healthy
Expand All @@ -41,9 +40,9 @@ services:
environment:
- AML_ALLOWED_HOSTS=${AML_ALLOWED_HOSTS}
- AML_CORS_ORIGIN_WHITELIST=${AML_CORS_ORIGIN_WHITELIST}
- AML_DEBUG=${AML_DEBUG}
- AML_LOCATION_PROVIDER=${AML_LOCATION_PROVIDER}
- AML_SECRET_KEY=${AML_SECRET_KEY}
- AML_INCLUDE_DEV_TOOLS=${AML_INCLUDE_DEV_TOOLS}
- DJANGO_SETTINGS_MODULE=${DJANGO_SETTINGS_MODULE}
- DJANGO_SUPERUSER_USERNAME=${DJANGO_SUPERUSER_USERNAME}
- DJANGO_SUPERUSER_EMAIL=${DJANGO_SUPERUSER_EMAIL}
Expand Down

0 comments on commit f8d407d

Please sign in to comment.