-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
71 lines (67 loc) · 1.66 KB
/
docker-compose.yml
File metadata and controls
71 lines (67 loc) · 1.66 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
60
61
62
63
64
65
66
67
68
69
70
71
services:
mongodb:
image: mongo:7
container_name: openpastebin-mongodb
restart: unless-stopped
command: ["mongod", "--quiet", "--logpath", "/dev/null"]
volumes:
- mongodb_data:/data/db
environment:
- MONGO_INITDB_DATABASE=openpastebin
networks:
- pastebin-network
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017/openpastebin --quiet
interval: 10s
timeout: 5s
retries: 5
logging:
driver: "none"
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: openpastebin-backend
restart: unless-stopped
ports:
- "5000:5000" # Expose for local testing - can be removed for production with reverse proxy
env_file:
- .env
environment:
- NODE_ENV=production
- PORT=5000
- MONGO_URI=mongodb://mongodb:27017/openpastebin
depends_on:
mongodb:
condition: service_healthy
networks:
- pastebin-network
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:5000/api/health"]
interval: 30s
timeout: 10s
retries: 3
logging:
driver: "none"
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: openpastebin-frontend
restart: unless-stopped
# Port 80 only internal - Caddy handles external access as reverse proxy
depends_on:
- backend
networks:
- pastebin-network
- caddy-net
logging:
driver: "none"
volumes:
mongodb_data:
driver: local
networks:
pastebin-network:
driver: bridge
caddy-net:
external: true