From fb637074869282b95ee627062427fcb122fd4970 Mon Sep 17 00:00:00 2001 From: victoriafabriss Date: Thu, 30 Nov 2023 11:22:56 -0300 Subject: [PATCH 1/2] Fix(nginx): Fixed nginx static files location --- infra/nginx/conf.d/fallback_server.conf | 8 -------- infra/nginx/vhost.d/default | 3 +++ infra/server/start_nginx_acme.sh | 1 + 3 files changed, 4 insertions(+), 8 deletions(-) delete mode 100644 infra/nginx/conf.d/fallback_server.conf create mode 100644 infra/nginx/vhost.d/default diff --git a/infra/nginx/conf.d/fallback_server.conf b/infra/nginx/conf.d/fallback_server.conf deleted file mode 100644 index d01f612..0000000 --- a/infra/nginx/conf.d/fallback_server.conf +++ /dev/null @@ -1,8 +0,0 @@ -server { - listen 80 default_server; - root /usr/share/nginx/static; - - location /static { - alias /usr/share/nginx/static; - } -} diff --git a/infra/nginx/vhost.d/default b/infra/nginx/vhost.d/default new file mode 100644 index 0000000..c05368f --- /dev/null +++ b/infra/nginx/vhost.d/default @@ -0,0 +1,3 @@ +location /static { + alias /usr/share/nginx/static; +} \ No newline at end of file diff --git a/infra/server/start_nginx_acme.sh b/infra/server/start_nginx_acme.sh index 093785b..25bbaa4 100644 --- a/infra/server/start_nginx_acme.sh +++ b/infra/server/start_nginx_acme.sh @@ -16,6 +16,7 @@ docker run --detach \ --volume ./infra/nginx/conf.d/custom_proxy.conf:/etc/nginx/conf.d/custom_proxy.conf \ --volume ./infra/nginx/conf.d/fallback_server.conf:/etc/nginx/conf.d/fallback_server.conf \ --volume staticfiles:/usr/share/nginx/static \ + --volume ./infra/nginx/vhost.d/default:/etc/nginx/vhost.d/default \ --network shared \ nginxproxy/nginx-proxy From 66c3be90b4dc60eeed71f80493c5eb927496b84e Mon Sep 17 00:00:00 2001 From: victoriafabriss Date: Thu, 30 Nov 2023 11:38:07 -0300 Subject: [PATCH 2/2] Fix(locale): Added locale volume into yml files, fixed media volume into local yml --- local.yml | 4 +++- production.yml | 2 ++ staging.yml | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/local.yml b/local.yml index 621f4e7..c6abadc 100644 --- a/local.yml +++ b/local.yml @@ -15,7 +15,8 @@ services: volumes: - ./src:/app/src - ./storage/static:/app/storage/static - - ./storage/static:/app/storage/media + - ./storage/media:/app/storage/media + - translations:/app/locale ports: - ${DJANGO_HTTP_PORT:-8000}:${DJANGO_HTTP_PORT:-8000} env_file: @@ -73,3 +74,4 @@ volumes: postgres_data: mediafiles: cache: + translations: diff --git a/production.yml b/production.yml index 2fcc969..13c29f0 100644 --- a/production.yml +++ b/production.yml @@ -11,6 +11,7 @@ services: dockerfile: infra/app/Dockerfile volumes: - staticfiles:/app/storage/static + - translations:/app/locale ports: - 80 env_file: @@ -44,6 +45,7 @@ volumes: staticfiles: external: true name: staticfiles + translations: networks: shared: diff --git a/staging.yml b/staging.yml index 7e33f1f..f876378 100644 --- a/staging.yml +++ b/staging.yml @@ -11,6 +11,7 @@ services: dockerfile: infra/app/Dockerfile volumes: - staticfiles:/app/storage/static + - translations:/app/locale ports: - 80 env_file: @@ -44,6 +45,7 @@ volumes: staticfiles: external: true name: staticfiles + translations: networks: shared: