-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprod.compose.yaml
More file actions
59 lines (54 loc) · 1.67 KB
/
prod.compose.yaml
File metadata and controls
59 lines (54 loc) · 1.67 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
services:
mongodb:
image: mongo:6.0
restart: unless-stopped
volumes:
- mongodb-data:/data/db
networks:
- brainbytes_net # Shared network with expressjs
expressjs:
image: ghcr.io/iodsky/brainbytes-api:latest
env_file:
- .env
environment:
- IS_DOCKERIZED=true
- NODE_ENV=production
depends_on:
- mongodb
command: ["node", "dist/index.js"]
# Metadata for reverse proxy and auto-updating
labels:
# Allow traefik to route to this service
- "traefik.enable=true"
# Route requests from brainbytes.iodsky.com to this service
- "traefik.http.routers.brainbytes.rule=Host(`brainbytes.iodsky.com`)"
# Enforce HTTPS
- "traefik.http.routers.brainbytes.entrypoints=websecure"
# Automatically request TLS certificates using Let's Encrypt
- "traefik.http.routers.brainbytes.tls.certresolver=myresolver"
# Route requests to port 8000
- "traefik.http.services.expressjs.loadbalancer.server.port=8000"
# Enable auto updates via watchtower
- "com.centurylinklabs.watchtower.enable=true"
networks:
- brainbytes_net
- traefik # Ensure connection with traefik
watchtower:
image: containrrr/watchtower
command:
- "--label-enable" # Monitor contianers with explicit watchtower label
- "--interval=3600"
environment:
WATCHTOWER_CLEANUP: true # Remove old images after update
volumes:
- /var/run/docker.sock:/var/run/docker.sock
restart: always
networks:
- brainbytes_net
volumes:
mongodb-data:
networks:
brainbytes_net: # Project-scope network
name: brainbytes_net
traefik:
external: true