From 59649fba1f2af8a0a8a29bd3dec8359293a75d76 Mon Sep 17 00:00:00 2001 From: Mariana Sartorato Date: Tue, 2 Jul 2024 11:19:17 -0300 Subject: [PATCH] feat: update docker-compose and proxy dockerfile closes #44 --- docker-compose.yml | 16 ++++++++++++++++ proxy/Dockerfile | 2 ++ proxy/etc/nginx/templates/default.conf.template | 6 +++++- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index fae52eb..c35ffb6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,7 @@ volumes: db-data: runtime-data: + static-data: networks: public: @@ -47,6 +48,19 @@ services: - DB_DEFAULT_PASSWORD_FILE=/run/secrets/postgres_password_secret - DB_DEFAULT_HOST=db + dashboard: + build: ./dashboard + restart: always + image: dashboard:latest + + collect_static: + build: './collect_static' + image: collect_static:latest + depends_on: + - dashboard + volumes: + - static-data:/data/static + proxy: build: ./proxy restart: always @@ -54,6 +68,8 @@ services: - backend networks: - public + volumes: + - static-data:/data/static ports: - target: 80 published: 80 diff --git a/proxy/Dockerfile b/proxy/Dockerfile index 5285c26..f3f19ba 100644 --- a/proxy/Dockerfile +++ b/proxy/Dockerfile @@ -1,3 +1,5 @@ FROM nginx:1.27.0-alpine +VOLUME ["/data/static"] + COPY etc/ /etc/ diff --git a/proxy/etc/nginx/templates/default.conf.template b/proxy/etc/nginx/templates/default.conf.template index fc23d2a..12826f0 100644 --- a/proxy/etc/nginx/templates/default.conf.template +++ b/proxy/etc/nginx/templates/default.conf.template @@ -1,5 +1,9 @@ server { - location / { + location /api { proxy_pass ${PROXY_TARGET}; } + location /{ + root /data/static; + try_files $uri /index.html; + } }