-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
32 lines (29 loc) · 1.02 KB
/
docker-compose.yml
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
version: '3.7'
services:
backend:
build: ./backend
ports:
- "1323:${NEXT_PUBLIC_BACKEND_PORT}" # Exposes the backend's port 1323 to the host
env_file:
- .env # Reads environment variables from a file
depends_on:
- redis # Ensures Redis service is started before the backend
restart: unless-stopped # Optional: Restarts the service unless it was stopped by the user
frontend:
build:
context: ./frontend
env_file:
- .env # Reads environment variables from a file
ports:
- "3000:3000" # Exposes the frontend's port 3000 to the host
depends_on:
- backend # Optional: Ensures backend service is started before the frontend
restart: unless-stopped # Optional: Restarts the service unless it was stopped by the user
redis:
image: "redis:alpine" # Uses the official Redis image
ports:
- "6379:6379" # Exposes the Redis port 6379 to the host
volumes:
- redis_data:/data # Mounts a volume to persist Redis data
volumes:
redis_data: