-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
60 lines (55 loc) · 1.47 KB
/
docker-compose.yml
File metadata and controls
60 lines (55 loc) · 1.47 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
services:
# NATS server with JetStream
nats:
image: nats:latest
container_name: nats
command: --http_port 8222 -js # Enable JetStream
expose:
- "4222" # NATS client port (internal only)
# ports:
# - "8222:8222" # NATS monitoring port (disabled)
networks:
- go-jobqueue-network
restart: unless-stopped
# Application service
app:
build: .
image: go-jobqueue:latest
environment:
- GIN_MODE=release
- NATS_URL=nats://nats:4222
networks:
- go-jobqueue-network
depends_on:
- nats
restart: unless-stopped
labels:
- "traefik.enable=true"
- "traefik.http.routers.go-jobqueue.rule=Host(`localhost`)"
- "traefik.http.services.go-jobqueue.loadbalancer.server.port=3000"
- "traefik.http.routers.go-jobqueue.entrypoints=web"
# Traefik load balancer
traefik:
image: traefik:v3.5
container_name: traefik
command:
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
- "--log.level=INFO"
ports:
- "80:80" # HTTP
- "443:443" # HTTPS
# - "8080:8080" # Traefik dashboard
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
networks:
- go-jobqueue-network
depends_on:
- app
restart: unless-stopped
networks:
go-jobqueue-network:
driver: bridge