-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
89 lines (80 loc) · 1.85 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
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
version: "3.5"
services:
# Base
app_base:
image: docker.pkg.github.com/letscode-io/timecodes-api/timecodes-api_base:latest
build:
context: .
dockerfile: Dockerfile.base
# Test
app_test:
build:
context: .
dockerfile: Dockerfile
target: base
depends_on:
- db
environment:
- CGO_ENABLED=0
env_file:
- .env.test
networks:
- default
volumes:
- ./tmp:/usr/src/app/tmp
- .:/usr/src/app
# Dev
app_dev:
build:
context: .
dockerfile: Dockerfile.dev
depends_on:
- db
env_file:
- .env
ports:
- "8080:8080"
volumes:
- .:/usr/src/app
# Production
app:
restart: always
build:
context: .
dockerfile: Dockerfile
target: final
depends_on:
- db
env_file:
- .env
ports:
- "8080"
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik-public"
- traefik.http.routers.timecodes-http.rule=Host(`${APP_HOST}`)
- "traefik.http.services.timecodes-service.loadbalancer.server.port=8080"
- traefik.http.routers.timecodes-http.entrypoints=http
- traefik.http.routers.timecodes-http.service=timecodes-service
- traefik.http.routers.timecodes-http.middlewares=https-redirect
- traefik.http.routers.timecodes-https.rule=Host(`${APP_HOST}`)
- traefik.http.routers.timecodes-https.entrypoints=https
- traefik.http.routers.timecodes-https.tls=true
- traefik.http.routers.timecodes-https.tls.certresolver=le
networks:
- traefik-public
- default
# Database
db:
image: postgres:12-alpine
env_file:
- .env
ports:
- 9000:5432
networks:
- default
volumes:
- ./tmp/postgresql-data:/var/lib/postgresql/data
networks:
traefik-public:
external: true