Skip to content

Commit

Permalink
Adjust context dir for django container
Browse files Browse the repository at this point in the history
  • Loading branch information
rachelekm committed May 6, 2022
1 parent ae1aeb0 commit 8868109
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
8 changes: 5 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ services:
- DJANGO_SECRET_KEY=secret
- DJANGO_LOG_LEVEL=INFO
build:
context: ./src/backend
dockerfile: Dockerfile
context: ./
dockerfile: ./src/backend/Dockerfile
volumes:
- ./src/backend:/usr/local/src/backend
- $HOME/.aws:/root/.aws:ro
- type: bind
source: ./taui/index.html
target: /usr/local/src/backend/static/index.html
- ./taui/assets:/usr/local/src/backend/static/assets
- ./taui/index.html:/usr/local/src/backend/static/index.html
working_dir: /usr/local/src/backend
depends_on:
database:
Expand Down
6 changes: 6 additions & 0 deletions scripts/update
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ if [ "${BASH_SOURCE[0]}" = "${0}" ]; then
# Ensure container images are current
docker-compose build

# Build static asset bundle
docker-compose \
-f docker-compose.yml \
run --rm --no-deps --entrypoint "bash -c" taui \
"yarn install && yarn build"

# Bring up PostgreSQL and Django in a way that respects
# configured service health checks.
docker-compose up -d database django
Expand Down
7 changes: 5 additions & 2 deletions src/backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ FROM quay.io/azavea/django:3.2-python3.10-slim
RUN mkdir -p /usr/local/src/backend
WORKDIR /usr/local/src/backend

COPY requirements.txt /usr/local/src/backend/
COPY /src/backend/requirements.txt /usr/local/src/backend/
RUN pip install --no-cache-dir -r requirements.txt

COPY . /usr/local/src/backend
COPY ./src/backend /usr/local/src/backend

COPY ./taui/assets*/ /usr/local/src/backend/static/assets
COPY ./taui/index.html /usr/local/src/backend/static/index.html

CMD ["-b :8085", \
"--workers=2", \
Expand Down

0 comments on commit 8868109

Please sign in to comment.