Update docker scripts and nginx conf (#542)

This commit is contained in:
Wu Clan
2025-03-11 23:26:53 +08:00
committed by GitHub
parent 5b42e59d65
commit 1e3e9ea84a
4 changed files with 10 additions and 15 deletions
View File
+2 -7
View File
@@ -2,14 +2,11 @@
## Docker
> [!IMPORTANT]
> Due to Docker context limitations, you can't build an image in this directory
1. Make sure you're at the root of the project
2. Run the following Docker command to build container:
```shell
docker build -f backend/Dockerfile -t fba_backend_independent .
docker build -f Dockerfile -t fba_backend_independent .
```
3. Start container
@@ -39,9 +36,7 @@
cd fastapi_best_architecture/backend
uv venv
uv pip install -r requirements.txt
uv sync --frozen
```
3. Checkout a new branch and make your changes
+2 -2
View File
@@ -46,10 +46,10 @@ server {
}
location /static {
alias /www/fba_server/backend/static;
alias /var/www/fba_server/backend/static;
}
location /static/upload {
alias /www/fba_server/backend/static/upload;
alias /var/www/fba_server/backend/static/upload;
}
}
@@ -1,8 +1,8 @@
services:
fba_server:
build:
context: ../../../
dockerfile: backend/Dockerfile
context: .
dockerfile: Dockerfile
image: fba_server:latest
container_name: fba_server
restart: always
@@ -11,7 +11,7 @@ services:
- fba_redis
- fba_celery
volumes:
- .env.server:/fba/backend/.env
- ./deploy/backend/docker-compose/.env.server:/fba/backend/.env
- fba_static:/fba/backend/app/static
networks:
- fba_network
@@ -80,7 +80,7 @@ services:
depends_on:
- fba_server
volumes:
- ../nginx.conf:/etc/nginx/conf.d/default.conf:ro
- ./deploy/backend/nginx.conf:/etc/nginx/conf.d/default.conf:ro
- fba_static:/www/fba_server/backend/static
- fba_static_upload:/www/fba_server/backend/static/upload
networks:
@@ -127,8 +127,8 @@ services:
fba_celery:
build:
context: ../../../
dockerfile: backend/Dockerfile
context: .
dockerfile: Dockerfile
args:
- SERVER_TYPE=celery
image: fba_celery:latest