-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
104 lines (99 loc) · 2.28 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
services:
postgrest:
restart: always
volumes:
- ./:/conf
build:
dockerfile: postgrest.Dockerfile
context: .
depends_on:
- db
ports:
- 3000:3000
networks:
- database
- caddy_postgrest
api:
restart: always
build:
context: .
dockerfile: api/Dockerfile
ports:
- "8087:8087"
volumes:
- "./static/product_pics:/product_pics"
- "./static/profile_pics:/profile_pics"
- "./reports:/go/src/reports"
- "./api/api.go:/go/src/api/api.go"
networks:
- caddy_postgrest
- api_auth
db:
restart: always
image: postgres:13 # the alpine image has known instabilities regarding file permissions
ports:
- "5432:5432"
environment:
# db and postgrest share a common _private_ and _internal_ network.
# as the postgrest server handles authentication and has the credentials
# anyway this is acceptable and saves us from handling db passwords.
POSTGRES_HOST_AUTH_METHOD: "trust"
volumes:
- "./pgdata:/var/lib/postgresql/data"
- "./postgres_schema.sql:/docker-entrypoint-initdb.d/schema.sql"
networks:
- database
caddy:
restart: always
image: caddy:2-alpine
ports:
- 80:80
- 443:443
volumes:
- "./caddy_data:/data"
- "./Caddyfile:/etc/caddy/Caddyfile"
- "./static:/static"
networks:
- caddy_postgrest
- default
- caddy_auth
auth:
restart: always
build:
context: .
dockerfile: auth/Dockerfile
volumes:
- type: bind
source: "./auth"
target: "/go/src/auth_server"
read_only: true
- type: bind
source: "./secrets.json"
target: "/go/src/secrets.json"
read_only: true
ports:
- "8080:8080"
networks:
- caddy_auth
- api_auth
cron:
restart: always
build:
context: .
dockerfile: cron.Dockerfile
volumes:
- ./db_backups:/db_backups
- ./reports:/reports
- ./cronjobs/hourly:/etc/periodic/hourly
- ./cronjobs/monthly:/etc/periodic/monthly
networks:
- database
networks:
database:
internal: true
caddy_postgrest:
internal: true
caddy_auth:
internal: true
api_auth:
internal: true