-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
59 lines (56 loc) · 2.15 KB
/
Copy pathdocker-compose.yml
File metadata and controls
59 lines (56 loc) · 2.15 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
47
48
49
50
51
52
53
54
55
56
57
58
59
version: '3.9'
services:
api:
build:
context: . # Refers to the current directory (project root)
dockerfile: API/Dockerfile
environment:
# --- ENVIRONMENT SWITCH: Uncomment ONE of the lines below ---
#- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_ENVIRONMENT=Production
# Connection strings and other environment variables for the API
- ConnectionStrings__DefaultConnection=Data Source=/data/flytospace.db
- Redis__Connection=redis:6379
volumes:
# Mount a host directory to persist SQLite database data
# Ensure /var/lib/flytospace exists on your host and has write permissions for Docker
- /var/lib/flytospace:/data
ports:
# Host:Container port mapping
# For API: Host port 5050 maps to container port 8080 (where Kestrel listens by default)
# This mapping is useful for direct access/debugging from the host on both Dev and Prod.
- "5050:8080"
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
container_name: flytospace-api
restart: always # Always restart the container if it stops
depends_on:
- redis # Ensure Redis starts before the API
client:
build:
context: ./client # Context for the Angular client's Dockerfile
dockerfile: Dockerfile
ports:
# Host:Container port mapping for the Angular client Nginx
# Host port 4200 maps to container port 80 (where Nginx serves Angular)
# Useful for direct access to the Angular app from the host on both Dev and Prod.
- "4200:80"
logging:
driver: "json-file"
options:
max-size: "5m"
max-file: "2"
container_name: flytospace-client
restart: always # Always restart the container if it stops
redis:
image: redis:7 # Use the official Redis 7 Docker image
container_name: redis
ports:
# Host:Container port mapping for Redis
# Host port 6379 maps to container port 6379
# Useful for direct access to Redis from the host (e.g., for Redis CLI)
- "6379:6379"
restart: unless-stopped # Restart unless explicitly stopped by user or Docker daemon