-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
90 lines (84 loc) · 2.14 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
services:
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
ports:
- "3000:3000"
networks:
- fleetflow-v1-network
depends_on:
- gobackend
environment:
- REACT_APP_API_URL=http://localhost:8000/api/v1
healthcheck:
test: ["CMD", "curl", "--fail", "http://localhost:3000"]
interval: 60s
retries: 5
start_period: 20s
timeout: 10s
gobackend:
container_name: gobackend
build:
context: ./backend
dockerfile: go.dockerfile
environment:
- DATABASE_URL=postgres://postgres_user:postgres_password@postgres_db:5432/fleetflow?sslmode=disable
- JWT_SECRET=3bZ/QyllJNEz9BzmmnM4twkJ8fy8BPhxudyxKGBSSdA=
ports:
- '8000:8000'
networks:
- fleetflow-v1-network
depends_on:
postgres_db:
condition: service_healthy
restart: on-failure
swagger:
image: swaggerapi/swagger-ui
ports:
- "8080:8080"
volumes:
- ./backend/docs:/usr/share/nginx/html
- ./backend/docs/swagger.json:/usr/share/nginx/html/swagger.json
- ./backend/docs/swagger-initializer.js:/usr/share/nginx/html/swagger-initializer.js
environment:
SWAGGER_JSON: /usr/share/nginx/html/swagger.json
networks:
- fleetflow-v1-network
depends_on:
- gobackend
postgres_db:
container_name: postgres_db
image: postgres:13-alpine
restart: always
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
ports:
- '5432:5432'
volumes:
- pgdata:/var/lib/postgresql/data
- ./backend/db/init/schema.sql:/docker-entrypoint-initdb.d/schema.sql
networks:
- fleetflow-v1-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 5s
timeout: 5s
retries: 5
start_period: 10s
adminer:
image: adminer
restart: always
ports:
- 8090:8080
depends_on:
- postgres_db
networks:
- fleetflow-v1-network
networks:
fleetflow-v1-network:
driver: bridge
volumes:
pgdata: {}