-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
46 lines (40 loc) · 1.64 KB
/
docker-compose.yaml
File metadata and controls
46 lines (40 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Это конфигурация для тестового запуска приложения на локальной машине.
# Для запуска приложения на production сервере, используйте другой файл конфигурации.
# docker compose up --build
services:
# Nginx proxy forwards requests to the appropriate service
nginx-proxy:
image: nginx:alpine
ports:
- "80:80" # Expose 80 port
volumes:
# Add configuration file for Nginx, read-only
- "./deploy/nginx.conf:/etc/nginx/conf.d/default.conf:ro"
#network_mode: host
# FastAPI backend service
api:
depends_on: [ db ] # Wait for the database to start
build:
context: ./backend
dockerfile: deploy/Dockerfile
restart: always # Restart the service if it fails
volumes:
- "./backend/settings.example.yaml:/code/settings.yaml:ro" # Configuration file, mount as read-only
- "./static:/code/static:rw" # Directory for storing static files
# Upload examples for preview
- "./backend/organizations.json:/code/organizations.json:ro"
- "./backend/static-shared:/code/static-shared:rw"
env_file: backend/.example.env # Set some settings for Uvicorn in backend/.env file
# MongoDB database service
db:
image: "mongo:7.0"
restart: always # Restart the service if it fails
volumes:
- "mongodb:/data/db" # Persist data in a volume
env_file: backend/.example.env # Set password for MongoDB in backend/.env file
# Nuxt frontend service
frontend:
build: ./frontend
restart: always # Restart the service if it fails
volumes:
mongodb: