-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
108 lines (106 loc) · 2.28 KB
/
docker-compose.yaml
File metadata and controls
108 lines (106 loc) · 2.28 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
services:
frontend:
container_name: frontend
build:
context: ./frontend
depends_on:
- speed-cube-time
ports:
- 8000:8000
volumes:
- ./frontend:/app
- /app/node_modules
environment:
- NODE_ENV=development
networks:
- client-side
speed-cube-time:
depends_on:
db:
condition: service_healthy
build:
context: .
dockerfile: cmd/server/Dockerfile.dev
volumes:
- .:/opt/app/api
container_name: speed-cube-time-rest-server
hostname: speed-cube-time-rest-server
networks:
localnet:
aliases:
- db
client-side:
ports:
- 80:8080
environment:
- DATABASE_URL=postgres://postgres:password@db:5432/cube?sslmode=disable
- APP_DSN=postgres://postgres:password@db:5432/cube?sslmode=disable
- PGHOST=db
- PGPORT=5432
- PGUSER=postgres
- PGPASSWORD=password
- PGDATABASE=cube
- PORT=8080
- JWT_SECRET=Dn84hN+gnUHaBY1ZPFvlr8EKu3pZEhfYtMMo7xUkdO0=
- TOKEN_EXPIRATION_MINUTES=4320
deploy:
restart_policy:
condition: on-failure
db:
image: postgres:latest
container_name: postgres
restart: always
networks:
- localnet
expose:
- 8080
- 5432
ports:
- 5432:5432
- 8080:8080
volumes:
- pgdata:/var/lib/postgresql/data
environment:
- PG_USER=postgres
- PG_PASSWORD=password
- PG_DATABASE=cube
healthcheck:
test: ["CMD-SHELL", "pg_isready -d cube -U postgres"]
interval: 1s
timeout: 5s
retries: 10
migrate: &basemigrate
container_name: migrate
profiles: ["tools"]
depends_on:
db:
condition: service_healthy
networks:
- localnet
image: migrate/migrate
entrypoint:
[
"migrate",
"-path",
"/migrations",
"-database",
"postgres://postgres:password@db:5432/cube",
]
command: up
links:
- db
volumes:
- ./migrations:/migrations
migrate-create:
<<: *basemigrate
entrypoint: migrate create -dir /migrations -ext sql
command: ""
database-reset:
<<: *basemigrate
command: ["drop", "-f"]
volumes:
pgdata:
networks:
localnet:
driver: bridge
client-side: