diff --git a/docker-compose.yml b/docker-compose.yml index 79dd9c11..3a147688 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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: diff --git a/scripts/update b/scripts/update index e691a7a9..90a52b1c 100755 --- a/scripts/update +++ b/scripts/update @@ -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 diff --git a/src/backend/Dockerfile b/src/backend/Dockerfile index 4e98e7a7..e5897d64 100644 --- a/src/backend/Dockerfile +++ b/src/backend/Dockerfile @@ -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", \