Repository navigation
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
110 lines (103 loc) · 2.65 KB
/
Copy pathdocker-compose.yaml
File metadata and controls
110 lines (103 loc) · 2.65 KB
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
services:
api:
container_name: ${APP_NAME}_api
build:
context: .
dockerfile: .docker/api/Dockerfile.api
target: production
args:
PHP_VERSION: ${PHP_VERSION:-cli}
COMPOSER_VERSION: ${COMPOSER_VERSION:-latest}
environment:
DB_CONNECTION: mariadb
DB_HOST: database
DB_DATABASE: ${DB_DATABASE:-${APP_NAME}}
DB_USERNAME: ${DB_USERNAME:-${APP_NAME}}
DB_PASSWORD: ${DB_PASSWORD:-${APP_NAME}}
REDIS_HOST: cache
depends_on:
database:
condition: service_healthy
cache:
condition: service_healthy
networks:
- appnet
restart: unless-stopped
website:
container_name: ${APP_NAME}_website
build:
context: .
dockerfile: .docker/website/Dockerfile.website
target: production
args:
NODE_VERSION: ${NODE_VERSION:-latest}
depends_on:
api:
condition: service_started
networks:
- appnet
restart: unless-stopped
database:
container_name: ${APP_NAME}_database
image: mariadb:${MARIADB_VERSION:-latest}
environment:
MARIADB_ROOT_PASSWORD: ${DB_ROOT_PASSWORD:-root}
MARIADB_DATABASE: ${DB_DATABASE:-${APP_NAME}}
MARIADB_USER: ${DB_USERNAME:-${APP_NAME}}
MARIADB_PASSWORD: ${DB_PASSWORD:-${APP_NAME}}
healthcheck:
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
interval: 5s
timeout: 5s
retries: 20
start_period: 10s
volumes:
- database_data:/var/lib/mysql
networks:
- appnet
restart: unless-stopped
cache:
container_name: ${APP_NAME}_cache
image: redis:${REDIS_VERSION:-latest}
command: ["redis-server", "--appendonly", "yes"]
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 20
volumes:
- cache_data:/data
networks:
- appnet
restart: unless-stopped
proxy:
container_name: ${APP_NAME}_proxy
image: nginx:${NGINX_VERSION:-latest}
depends_on:
api:
condition: service_started
website:
condition: service_started
volumes:
- ./.docker/proxy/nginx.conf:/etc/nginx/conf.d/default.conf:ro
networks:
- appnet
restart: unless-stopped
tunnel:
container_name: ${APP_NAME}_tunnel
image: cloudflare/cloudflared:${CLOUDFLARED_VERSION:-latest}
command: tunnel --no-autoupdate run
environment:
TUNNEL_TOKEN: ${CLOUDFLARE_TUNNEL_TOKEN:-}
depends_on:
proxy:
condition: service_started
networks:
- appnet
restart: unless-stopped
volumes:
cache_data:
database_data:
networks:
appnet:
driver: bridge