-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
141 lines (131 loc) · 4.47 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
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
version: "3.7"
services:
frontend:
build:
context: ./frontend
dockerfile: Dockerfile.dev
container_name: sh-webar-frontend
image: sh-webar-frontend
environment:
APP_PORT: "${FRONTEND_APP_DEV_PORT}"
API_BASE_URL: "${FRONTEND_BASE_DEV_URL}"
VITE_API_BASE_URL: "${API_DEV_URL}"
VITE_API_DEV_REMOTE_BASE_URL: "${API_DEV_REMOTE_URL}"
VITE_DEV_LOCAL_ASSETS_BASE_URL: "${STRAPI_DEV_LOCAL_ASSETS_BASE_URL}"
VITE_DEV_REMOTE_ASSETS_BASE_URL: "${STRAPI_DEV_REMOTE_ASSETS_BASE_URL}"
VITE_STRAPI_AUTH_TOKEN: "${STRAPI_DEV_AUTH_TOKEN}"
volumes:
- ./frontend/src:/app/src
- ./frontend/public:/app/public
- ./frontend/index.html:/app/index.html
- ./frontend/vite.config.js:/app/vite.config.js
security_opt:
- no-new-privileges:true
depends_on:
- strapi
- load-balancer
labels:
- "traefik.enable=true"
- "traefik.http.routers.frontend.tls=true"
- "traefik.http.routers.frontend.rule=Host(`frontend.app.localhost`)||Host(`192.168.178.58`)"
- "traefik.http.routers.frontend.entrypoints=web,websecure"
- "traefik.docker.network=sh-web-ar-network-proxy"
networks:
- sh-web-ar-network-proxy
- sh-web-ar-network-backend
strapi:
build:
context: ./cms
dockerfile: Dockerfile.dev
container_name: sh-webar-cms
image: sh-webar-cms
environment:
HOST: "${CMS_HOST}"
URL: "${CMS_DEV_URL}"
PORT: "${CMS_DEV_PORT}"
DATABASE_NAME: "${DATABASE_NAME}"
DATABASE_HOST: "${DATABASE_HOST}"
DATABASE_PORT: "${DATABASE_PORT}"
DATABASE_USERNAME: "${DATABASE_USERNAME}"
DATABASE_PASSWORD: "${DATABASE_PASSWORD}"
DATABASE_SSL: "${DATABASE_SSL}"
JWT_SECRET: "${JWT_SECRET}"
ADMIN_JWT_SECRET: "${ADMIN_JWT_SECRET}"
APP_KEYS: "${APP_KEYS}"
API_TOKEN_SALT: "${API_TOKEN_SALT}"
volumes:
- ./cms/src:/app/src
- ./cms/config:/app/config
- ./cms/public:/app/public
security_opt:
- no-new-privileges:true
depends_on:
- postgres
- load-balancer
labels:
- "traefik.enable=true"
- "traefik.docker.network=sh-web-ar-network-proxy"
# Main Strapi router (localhost)
- "traefik.http.routers.strapi.tls=true"
- "traefik.http.routers.strapi.rule=Host(`cms.app.localhost`)"
- "traefik.http.routers.strapi.entrypoints=web,websecure"
# Remote Strapi router (for access from mobile devices)
- "traefik.http.routers.strapi-remote.tls=true"
- "traefik.http.routers.strapi-remote.rule=Host(`192.168.178.58`)"
- "traefik.http.routers.strapi-remote.entrypoints=strapi-remote"
- "traefik.http.routers.strapi-remote.service=strapi-remote-service"
- "traefik.http.services.strapi-remote-service.loadbalancer.server.port=1337"
networks:
- sh-web-ar-network-proxy
- sh-web-ar-network-backend
postgres:
image: postgres
container_name: sh-webar-db-development
environment:
POSTGRES_DB: "${POSTGRES_DB}"
POSTGRES_USER: "${POSTGRES_USER}"
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"
volumes:
- sh-webar-db-data-development:/var/lib/postgresql/data
ports:
- "${DATABASE_PORT}:${DATABASE_PORT}"
networks:
- sh-web-ar-network-backend
load-balancer:
image: traefik:latest
container_name: sh-webar-load-balancer
security_opt:
- no-new-privileges:true
command:
- "--api.insecure=true"
- "--api.dashboard=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
- "--entrypoints.strapi-remote.address=:1337"
- "--providers.file.directory=/etc/traefik/dynamic_conf"
- "--providers.docker.network=sh-web-ar-network-proxy"
labels:
- "traefik.enable=true"
- "traefik.http.routers.api.rule=Host(`traefik.app.localhost`)"
- "traefik.http.routers.api.entrypoints=web,websecure"
- "traefik.http.routers.api.service=api@internal"
ports:
- "443:443"
- "1337:1337"
- "8080:8080"
- "80:80"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./certs:/etc/certs:ro
- ./traefik/dev/dynamic_conf.yml:/etc/traefik/dynamic_conf/conf.yml:ro
networks:
- sh-web-ar-network-proxy
networks:
sh-web-ar-network-proxy:
external: true
sh-web-ar-network-backend:
external: true
volumes:
sh-webar-db-data-development: