-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
116 lines (102 loc) · 2.36 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
104
105
106
107
108
109
110
111
112
113
114
115
116
version: '3.4'
services:
# Routing and SSL certificates
nginx:
image: nginx:stable-alpine
networks:
- frontend
- backend
links:
- api
- frontend
ports:
- "8080:80"
volumes:
- ./nginx/default.dev.conf:/etc/nginx/conf.d/default.conf
restart: always
frontend:
container_name: haskell-bazaar-repl
stdin_open: true
tty: true
build:
dockerfile: Dockerfile.dev
context: ./frontend
volumes:
- /clj/target
- /clj/node_modules
- /clj/resources/public/js/compiled
- ./frontend:/clj
networks:
- backend
healthcheck:
test: ["CMD", "nc", "-vz", "127.0.0.1 3449"]
ports:
- "3449:3449" # Figwheel
restart: always
api:
container_name: haskell-bazaar-api
build:
context: ./backend
dockerfile: Dockerfile.dev
networks:
- backend
links:
- postgres
depends_on:
- postgres
volumes:
- /opt/build/.stack-work
- ./backend:/opt/build
command: >
sh -c "stack build &&
stack exec haskell-bazaar-exe"
environment:
- ENVIRONMENT=Dev
secrets:
- mailchimp-api-key
- mailchimp-base-url
- mailchimp-list-id
- psql-user
- psql-password
- psql-db
postgres:
image: postgres:11.1
container_name: haskell-bazaar-postgres
networks:
- backend
healthcheck:
test: ["CMD", "pg_isready", "-U", "haskellbazaar"]
volumes:
- psql-data:/var/lib/postgresql/data
# Run init.sql and seed.sql on creation
- ./db/scripts/init.sql:/docker-entrypoint-initdb.d/1-init.sql
- ./db/scripts/seed.sql:/docker-entrypoint-initdb.d/2-seed.sql
secrets:
- psql-user
- psql-password
- psql-db
environment:
- POSTGRES_USER_FILE=/run/secrets/psql-user
- POSTGRES_PASSWORD_FILE=/run/secrets/psql-password
- POSTGRES_DB_FILE=/run/secrets/psql-db
- POSTGRES_PORT=5432
volumes:
psql-data:
secrets:
# Postgresql
psql-user:
file: ./secrets/psql-user
psql-password:
file: ./secrets/psql-password
psql-db:
file: ./secrets/psql-db
# Mailchimp
mailchimp-api-key:
file: ./secrets/mailchimp-api-key
mailchimp-base-url:
file: ./secrets/mailchimp-base-url
mailchimp-list-id:
file: ./secrets/mailchimp-list-id
networks:
frontend:
backend: