-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
56 lines (51 loc) · 1.26 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
version: '3.8'
services:
db:
container_name: task_db
image: mysql:8
command: ['--sql_mode=TRADITIONAL', '--character-set-server=utf8mb4', '--collation-server=utf8mb4_unicode_ci', '--authentication_policy=mysql_native_password', '--mysql-native-password=ON']
environment:
- MYSQL_ROOT_PASSWORD=example
ports:
- 3306:3306
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
timeout: 20s
retries: 10
api:
container_name: task_api
build:
context: .
dockerfile: ./docker/api/Dockerfile
ports:
- "3000:3000"
depends_on:
db:
condition: service_healthy
environment:
DB_USER: root
DB_PASSWORD: example
DB_HOST: db
DB_PORT: 3306
ALLOWED_CORS_ORIGINS: localhost:3001
volumes:
- .:/app
tty: true
command: sh -c "bin/rails db:prepare && bin/rails s -b 0.0.0.0"
ui:
container_name: task_app
build:
context: .
dockerfile: ./docker/client/Dockerfile
ports:
- "3001:3000"
tty: true
depends_on:
- api
environment:
REACT_APP_CLIENT_ID: webapp_id
REACT_APP_CLIENT_SECRET: web_app_secret
REACT_APP_API: http://localhost:3000
volumes:
db-data:
driver: local