-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yaml
89 lines (82 loc) · 3.29 KB
/
docker-compose.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
version: "3"
name: node-app
services:
proxy:
image: traefik:v2.5
command:
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedByDefault=false"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
- "--certificatesResolvers.myresolver.acme.httpChallenge.entryPoint=web"
- "--certificatesResolvers.myresolver.acme.email=youremail@example.com"
- "--certificatesResolvers.myresolver.acme.storage=/acme.json"
- "--entrypoints.web.http.redirections.entryPoint.to=websecure"
- "--entrypoints.web.http.redirections.entryPoint.scheme=https"
- "--entrypoints.web.http.redirections.entryPoint.permanent=true"
ports:
- "80:80"
- "443:443"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- ".docker/config/traefik/acme.json:/acme.json"
labels:
- "traefik.enable=true"
- "traefik.http.routers.traefik.rule=Host(`proxy.local`)"
- "traefik.http.routers.traefik.service=api@internal"
- "traefik.http.routers.traefik.entrypoints=websecure"
- "traefik.http.routers.traefik.tls.certresolver=myresolver"
frontend:
build:
context: .docker/build/app
environment:
- NODE_OPTIONS=--openssl-legacy-provider
working_dir: /var/www/
command: npm run dev
volumes:
- ./frontend:/var/www
- ./public:/var/www/dist
depends_on:
- proxy
- backend
labels:
- "traefik.enable=true"
- "traefik.http.routers.frontend.rule=Host(`${APP_URL}`) && !PathPrefix(`${APP_API_BASE_PATH_LARAVEL}`) && !PathPrefix(`${APP_API_BASE_PATH_NODE}`)"
- "traefik.http.routers.frontend.entrypoints=websecure"
- "traefik.http.routers.frontend.tls=true"
- "traefik.http.services.frontend.loadbalancer.server.port=8080"
backend:
build:
context: .docker/build/app
environment:
- NODE_OPTIONS=--openssl-legacy-provider
working_dir: /var/www/
volumes:
- ./backend:/var/www
command: npm run serve
# entrypoint: ./entrypoint.sh
tty: true
depends_on:
- proxy
labels:
- "traefik.enable=true"
- "traefik.http.routers.backend.rule=Host(`${APP_URL}`) && PathPrefix(`${APP_API_BASE_PATH_NODE}`)"
- "traefik.http.routers.backend.entrypoints=websecure"
- "traefik.http.routers.backend.tls=true"
- "traefik.http.services.backend.loadbalancer.server.port=8080"
- "traefik.http.routers.backend.middlewares=backend_repath"
- "traefik.http.middlewares.backend_repath.replacepathregex.regex=^${APP_API_BASE_PATH_NODE}/(.*)"
- "traefik.http.middlewares.backend_repath.replacepathregex.replacement=/$${1}"
backend-laravel:
image: rpopuc/php-fpm-nginx:8.3
volumes:
- ./backend-laravel:/var/www
labels:
- "traefik.enable=true"
- "traefik.http.routers.laravel.rule=Host(`${APP_URL}`) && PathPrefix(`${APP_API_BASE_PATH_LARAVEL}`)"
- "traefik.http.routers.laravel.entrypoints=websecure"
- "traefik.http.routers.laravel.tls=true"
- "traefik.http.routers.laravel.middlewares=laravel_repath"
- "traefik.http.middlewares.laravel_repath.replacepathregex.regex=^${APP_API_BASE_PATH_LARAVEL}/(.*)"
- "traefik.http.middlewares.laravel_repath.replacepathregex.replacement=/api/$${1}"