-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
75 lines (74 loc) · 2.51 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
# Access via "http://localhost:8888"
# phpmyadmin Access via "http://localhost:8889"
# (or "http://$(docker-machine ip):8080" if using docker-machine)
version: '3.1'
services:
router:
image: traefik:v2.4
container_name: router
ports:
- 80:80
- 8080:8080
restart: always
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
command:
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
couchdb:
image: couchdb:3.1
container_name: couchdb
ports:
- 5984:5984
restart: always
environment:
COUCHDB_USER: ${DBU}
COUCHDB_PASSWORD: ${DBP}
COUCHDB_SECRET: ${DBS}
NODENAME: ${DBN}
volumes:
- ./couchdb/data:/home/couchdb/data:z
- ./couchdb/config:/opt/couchdb/etc/local.d/:z
labels:
- "traefik.enable=true"
- "traefik.http.services.couchdb.loadbalancer.server.port=5984"
- "traefik.http.routers.couchdb.rule=PathPrefix(`/couchdb`)"
- "traefik.http.routers.couchdb.middlewares=couchdb-stripprefix"
- "traefik.http.middlewares.couchdb-stripprefix.stripprefix.prefixes=/couchdb"
backend:
image: node:15-alpine3.10
container_name: backend
ports:
- 8888:8888
restart: always
volumes:
- ./backend:/home/node/app:z
working_dir: /home/node/app
command: sh -c "/usr/local/bin/npm update && node ./index.js"
labels:
- "traefik.enable=true"
- "traefik.http.services.backend.loadbalancer.server.port=8888"
- "traefik.http.routers.backend.entrypoints=web"
- "traefik.http.routers.backend.rule=PathPrefix(`/backend`)"
- "traefik.http.routers.backend.middlewares=backend-stripprefix"
- "traefik.http.middlewares.backend-stripprefix.stripprefix.prefixes=/backend"
frontend:
image: httpd:2.4-alpine
container_name: "frontend"
ports:
- 8889:80
restart: always
volumes:
- ./frontend:/usr/local/apache2/htdocs:z
environment:
API: "${API}"
labels:
- "traefik.enable=true"
- "traefik.http.routers.frontend.entrypoints=web"
- "traefik.http.services.frontend.loadbalancer.server.port=80"
- "traefik.http.routers.frontend.rule=PathPrefix(`/frontend`)"
- "traefik.http.routers.frontend.middlewares=frontend-stripprefix"
- "traefik.http.middlewares.frontend-stripprefix.stripprefix.prefixes=/frontend"
- "traefik.http.middlewares.frontend.stripprefix.forceSlash=true"