This repository has been archived by the owner on Jan 14, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathdocker-compose.yml
85 lines (80 loc) · 2.1 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
services:
api:
build:
context: ./docker
dockerfile: Dockerfile-nodejs
command: ["npm", "start"]
depends_on:
database:
condition: service_healthy
setup:
condition: service_completed_successfully
environment:
HTTPS_ALWAYS: 0
PORT: 3000
SESSION_SECRET: development-secret
STORAGE_PATH: /storage
DB_DATABASE: project_loved
DB_HOST: database
DB_PASSWORD: ""
DB_PORT: 3306
DB_USER: project_loved
DOCKER_HOST_UID_SOURCE_DIR: /app/server
volumes:
- api_storage:/storage
- ./bridge:/app/bridge
- ./server:/app/server
working_dir: /app/server
assets:
build:
context: ./docker
dockerfile: Dockerfile-nodejs
command: ["npm", "start"]
depends_on:
setup:
condition: service_completed_successfully
environment:
DOCKER_HOST_UID_SOURCE_DIR: /app/client
volumes:
- ./bridge:/app/bridge
- ./client:/app/client
working_dir: /app/client
database:
build:
context: ./docker
dockerfile: Dockerfile-database
# copied from osu-web
# https://github.com/ppy/osu-web/blob/61519272e3eff722928305b3acae1991983c41ae/docker-compose.yml#L94-L101
healthcheck:
# important to use 127.0.0.1 instead of localhost as mysql starts twice.
# the first time it listens on sockets but isn't actually ready
# see https://github.com/docker-library/mysql/issues/663
test: ["CMD", "mysqladmin", "ping", "-h", "127.0.0.1"]
interval: 1s
timeout: 60s
start_period: 60s
ports:
- "${DOCKER_EXTERNAL_MYSQL_PORT:-3306}:3306"
volumes:
- database:/var/lib/mysql
nginx:
image: nginx:1.23
depends_on:
- api
- assets
ports:
- "${DOCKER_EXTERNAL_NGINX_PORT:-8080}:80"
volumes:
- ./docker/nginx.conf:/etc/nginx/conf.d/default.conf
setup:
build:
context: ./docker
dockerfile: Dockerfile-nodejs
command: ["/setup-cmd.sh"]
environment:
DOCKER_HOST_UID_SOURCE_DIR: /app
volumes:
- .:/app
volumes:
api_storage:
database: