-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.production.yml
122 lines (115 loc) · 3.82 KB
/
docker-compose.production.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
version: '3.7'
variables:
TEAM_NAME: museum4punkt0
PROJECT_NAME: museum4punkt0
FRONTEND_NAME: nuxt
BACKEND_NAME: strapi
FRONTEND_GATEWAY_NAME: frontend-gateway
# following part should not be changed
DOCKER_REGISTRY_HOST: ${DOCKER_REGISTRY_HOST}
DOCKER_REGISTRY_PORT: 5050
DOCKER_REGISTRY: $DOCKER_REGISTRY_HOST:$DOCKER_REGISTRY_PORT
FRONTEND_IMAGE: $DOCKER_REGISTRY/$TEAM_NAME/$PROJECT_NAME/$FRONTEND_NAME
BACKEND_IMAGE: $DOCKER_REGISTRY/$TEAM_NAME/$PROJECT_NAME/$BACKEND_NAME
FRONTEND_GATEWAY_IMAGE: $DOCKER_REGISTRY/$TEAM_NAME/$PROJECT_NAME/$FRONTEND_GATEWAY_NAME
TOP_DOMAIN: ${TOP_DOMAIN}
BACKEND_DOMAIN: ${BACKEND_DOMAIN:$PROJECT_NAME-backend.$TOP_DOMAIN}
FRONTEND_DOMAIN: ${FRONTEND_DOMAIN:$PROJECT_NAME-frontend.$TOP_DOMAIN}
FRONTEND_GATEWAY_DOMAIN: ${FRONTEND_GATEWAY_DOMAIN:$PROJECT_NAME.$TOP_DOMAIN}
services:
backend:
image: ${BACKEND_IMAGE}:latest
deploy:
labels:
traefik.backend.circuitbreaker.expression: NetworkErrorRatio() > 0.1
traefik.docker.network: public
traefik.enable: "true"
traefik.frontend.rule: ${BACKEND_GATEWAY_DOMAIN}
traefik.port: '1337'
environment:
NODE_ENV: production # check if it works for logging
MAIL_TRANSPORT_HOST: ${MAIL_TRANSPORT_HOST}
MAIL_TRANSPORT_PORT: ${MAIL_TRANSPORT_PORT}
MAIL_TRANSPORT_SECURITY: ${MAIL_TRANSPORT_SECURITY}
MAIL_TRANSPORT_USER: ${MAIL_TRANSPORT_USER}
MAIL_TRANSPORT_PASSWORD: ${MAIL_TRANSPORT_PASSWORD}
MAIL_TRANSPORT_FROM_ADDRESS: ${MAIL_TRANSPORT_FROM_ADDRESS}
MAIL_TRANSPORT_TO_ADDRESS: ${MAIL_TRANSPORT_TO_ADDRESS}
APP_KEYS: ${STRAPI_APP_KEYS}
API_TOKEN_SALT: ${STRAPI_API_TOKEN_SALT}
ADMIN_JWT_SECRET: ${STRAPI_ADMIN_JWT_SECRET}
DATABASE_FILENAME: ${DATABASE_FILENAME}
JWT_SECRET: ${STRAPI_JWT_SECRET}
DATABASE_CLIENT: mysql
DATABASE_HOST: db
DATABASE_PORT: 3306
DATABASE_NAME: strapi
DATABASE_USERNAME: strapi
DATABASE_PASSWORD: strapi
DATABASE_SSL: 'false'
# DVS_ALLOW_ACCESS_ORIGIN:'localhost:3000'
# RECAPTCHA_PRIVATE_KEY: "${RECAPTCHA_PRIVATE_KEY}"
# TEST_USER_GUID: "${TEST_USER_GUID}"
volumes:
- m4p0-uploads-production:/opt/app/public/uploads
networks:
public: {}
m4p0-prod-network: {}
stop_signal: SIGINT
# depends_on:
# - db
# # condition: service_healthy
db:
image: mariadb
volumes:
- m4p0-data-production:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: strapi
MYSQL_DATABASE: strapi
MYSQL_USER: strapi
MYSQL_PASSWORD: strapi
healthcheck:
test: mysqladmin ping -h 127.0.0.1 -u $$MYSQL_USER --password=$$MYSQL_PASSWORD
start_period: 5s
interval: 5s
timeout: 5s
retries: 55
networks:
m4p0-prod-network: {}
frontend:
environment:
NODE_ENV: production
TEXT_CONTENT_API: ${TEXT_CONTENT_API_PROD}
GMAP_API_KEY: ${GMAP_API_KEY}
image: ${FRONTEND_IMAGE}:latest
deploy:
labels:
traefik.backend.circuitbreaker.expression: NetworkErrorRatio() > 0.1
traefik.docker.network: public
traefik.enable: "true"
traefik.frontend.rule: ${FRONTEND_DOMAIN}
traefik.port: '3000'
networks:
public: {}
frontend-gateway:
image: ${FRONTEND_GATEWAY_IMAGE}:latest
deploy:
labels:
traefik.backend.circuitbreaker.expression: NetworkErrorRatio() > 0.1
traefik.docker.network: public
traefik.enable: "true"
traefik.frontend.rule: ${FRONTEND_DOMAIN}
traefik.port: '80'
environment:
NUXT_SERVER_URL: ${NUXT_SERVER_URL}
STRAPI_SERVER_URL: ${STRAPI_SERVER_URL}
networks:
public: {}
networks:
public:
external: true
name: public
m4p0-prod-network: {}
volumes:
m4p0-data-production:
m4p0-uploads-production: