-
Notifications
You must be signed in to change notification settings - Fork 10
/
docker-compose.yml
75 lines (74 loc) · 1.49 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
version: '3.9'
services:
redis:
image: redis:alpine3.12
ports:
- "6379:6379"
volumes:
- /docker/host/dir:/data
command: redis-server --appendonly yes
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
interval: 1s
timeout: 3s
retries: 30
postgresql:
image: postgres:13.1-alpine
restart: always
volumes:
- $PWD/data:/var/lib/postgresql/data
# You should add all .env files to .gitignore
env_file:
- ./env/postgre.env
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
ports:
- '5432:5432'
depends_on:
redis:
condition: service_healthy
server:
build:
context: server
environment:
GIN_MODE: release
ports:
- '8000:8000'
volumes:
- ./server:/app
depends_on:
postgresql:
condition: service_healthy
app:
build:
context: app
stdin_open: true
tty: true
volumes:
- ./app:/build
ports:
- "8080:8080"
env_file:
- ./env/flutter.env
command: >
sh -c "flutter pub get
&& flutter run -d web-server --web-port 8080 --web-hostname 0.0.0.0"
depends_on:
- server
nginx:
build:
context: nginx
image: nginx:stable-alpine
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
ports:
- "80:80"
depends_on:
- app
- server
volumes:
data:
redis-data: