Skip to content

Commit

Permalink
fix: Делаем постоянным приложением фронтенд
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis-Shtanskiy committed Aug 9, 2024
1 parent 1018649 commit e3f1c0c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
6 changes: 3 additions & 3 deletions infra/docker-compose-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ services:

frontend:
image: ${DOCKERHUB_USERNAME}/${PROJECT_NAME}_frontend_${BRANCH_TAG}:latest
command: cp -r /app/.next/server/app/. /frontend_static/
env_file: .env
environment:
- TZ=Europe/Moscow
volumes:
- static_volume:/frontend_static
- static_volume:/app/.next/static
depends_on:
db:
- backend
- db:
condition: service_healthy

nginx:
Expand Down
16 changes: 9 additions & 7 deletions infra/nginx/nginx_dev.conf
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@ server {
proxy_set_header X-CSRFToken $cookie_csrftoken;
}

location /static {
alias /staticfiles;
}

location / {
try_files $uri $uri.html $uri/ =404;
proxy_pass http://frontend:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}

error_page 404 /404.html;
location = /404.html {
root /staticfiles;
internal;
}
}

0 comments on commit e3f1c0c

Please sign in to comment.