-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.yml
81 lines (77 loc) · 1.76 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
version: "3"
services:
db:
image: postgres:alpine
container_name: project_database
env_file: .env
ports:
- 5432:5432
volumes:
- postgres:/var/lib/postgresql/data
networks:
- apps
api:
build:
context: .
dockerfile: Dockerfile.api
image: project_api:dev
container_name: project_api
labels:
- traefik.enable=true
- traefik.docker.network=apps
- traefik.http.routers.api.rule=Host(`api-rubyonrails-react-template`)
- traefik.http.routers.api.rule=PathPrefix(`/api/v1`)
env_file: .env
volumes:
- ./server/api:/var/www/api
ports:
- 3000:3000
links:
- db
depends_on:
- db
networks:
- apps
client:
stdin_open: true
build:
context: .
dockerfile: Dockerfile.client
image: project_client:dev
container_name: project_client
labels:
- traefik.enable=true
- traefik.docker.network=apps
- traefik.http.routers.client.rule=Host(`client-rubyonrails-react-template`)
- traefik.http.routers.client.rule=PathPrefix(`/`)
env_file: .env
volumes:
- ./client:/var/www/client
- /var/www/client/node_modules
ports:
- 5000:5000
links:
- api
depends_on:
- api
networks:
- apps
reverse-proxy:
image: traefik:v2.3
container_name: project_reverse_proxy
command:
- --api.insecure=true
- --providers.docker=true
- --providers.docker.exposedByDefault=false
ports:
- 80:80
- 8080:8080
volumes:
- /var/run/docker.sock:/var/run/docker.sock
networks:
- apps
volumes:
postgres:
networks:
apps:
driver: bridge