forked from vacaramin/Virtual-Horizon
-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose-ci.yaml
91 lines (81 loc) · 1.82 KB
/
docker-compose-ci.yaml
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
version: '3.8'
networks:
vh-net:
name: vh-net
driver: bridge
ipam:
driver: default
config:
- subnet: 172.19.0.0/16
gateway: 172.19.0.1
services:
db:
image: postgres
container_name: pg-database
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: helloworld
POSTGRES_DB: postgres
ports:
- "5434:5432"
restart: always
networks:
- vh-net
user: postgres
volumes:
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
- db-data:/var/lib/postgresql/data
migrate:
image: migrate/migrate
networks:
- vh-net
volumes:
- ./backend/Migrations:/migrations
depends_on:
- db
entrypoint: ["/bin/sh", "-c"]
command: >
'yes | migrate -path /migrations -database "postgres://postgres:helloworld@db:5432/postgres?sslmode=disable" down &&
migrate -path /migrations -database "postgres://postgres:helloworld@db:5432/postgres?sslmode=disable" up'
backend:
build:
context: ./backend
dockerfile: ./Dockerfile
env_file:
- ./backend/.env
ports:
- "4000:4000"
depends_on:
- migrate
- db
networks:
- vh-net
frontend:
build:
context: ./frontend
dockerfile: ./Dockerfile
ports:
- "3000:3000"
depends_on:
- backend
networks:
- vh-net
volumes:
- /app/node_modules
- ./frontend:/app
# pgadmin:
# container_name: pgadmin
# environment:
# - PGADMIN_DEFAULT_PASSWORD=helloworld
# hostname: service-pgadmin
# ports:
# - '5555:80'
# image: dpage/pgadmin4
# volumes:
# - ./.data/pgadmin:/var/lib/pgadmin
# networks:
# vh-net:
# ipv4_address: 172.19.0.6
volumes:
db-data: