-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
71 lines (67 loc) · 1.81 KB
/
docker-compose.yaml
File metadata and controls
71 lines (67 loc) · 1.81 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
60
61
62
63
64
65
66
67
68
69
70
71
services:
db:
image: mysql:latest
container_name: db
ports:
# Default MySQL port.
- "3306:3306"
env_file:
- ./config/db.env
# This allows to start the justchess service only when mysql is ready
# to accepts new connections. Otherwise justchess will crush after
# first unsuccessfull connection try.
healthcheck:
test: mysqladmin ping -h 127.0.0.1 -u $$MYSQL_USER --password=$$MYSQL_PASSWORD
retries: 10
timeout: 2s
volumes:
- ./config/db.conf:/etc/mysql/conf.d/my.cnf:ro
# Make db data persistent.
- db_data:/var/lib/mysql
logging:
options:
max-size: "10m"
max-file: "3"
justchess:
build:
context: .
dockerfile: ./docker/justchess.Dockerfile
container_name: justchess
env_file:
- ./config/justchess.env
depends_on:
db:
condition: service_healthy
ports:
- "3502:3502"
volumes:
# Mount source code from host OS.
- ./repo/justchess:/app/src
# Mount migrations from host OS.
- ./db/migrations:/app/migrations
logging:
options:
max-size: "10m"
max-file: "3"
stop_grace_period: 1s
entrypoint: go run -race cmd/justchess/main.go
webpack:
build:
context: .
dockerfile: ./docker/webpack.Dockerfile
container_name: webpack
working_dir: /app
volumes:
# Mount scripts from host OS.
- ./repo/justchess/_web/scripts:/app/scripts
# Mount css files from host OS.
- ./repo/justchess/_web/styles:/app/styles
- ./repo/justchess/_web/bundles:/app/bundles
command: sh -c "npx webpack --config ./webpack.config.mjs --watch --watch-options-poll=1000"
mailpit:
image: axllent/mailpit
container_name: mailpit
ports:
- "8025:8025"
volumes:
db_data: