forked from TheRestartProject/restarters.net
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
90 lines (84 loc) · 2.28 KB
/
docker-compose.prod.yml
File metadata and controls
90 lines (84 loc) · 2.28 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
# Production docker-compose file for Restarters
# This file is designed to test the production image locally
#
# Services:
# - nginx: Reverse proxy server (port 8001)
# - restarters_prod: Production PHP-FPM application
# - restarters_db_prod: MySQL database
version: '3.8'
services:
# Nginx reverse proxy
nginx:
image: nginx:alpine
container_name: restarters_nginx_prod
restart: unless-stopped
ports:
- "8001:80"
volumes:
- ./docker/production/nginx.conf:/etc/nginx/conf.d/default.conf:ro
- ./public:/var/www/public:ro
depends_on:
restarters_prod:
condition: service_healthy
networks:
- app-network-prod
# Production Restarters application
restarters_prod:
build:
context: .
dockerfile: docker/production/Dockerfile.prod
target: production
container_name: restarters_prod
restart: unless-stopped
depends_on:
restarters_db_prod:
condition: service_healthy
environment:
- MIGRATE=true
- SEED_SKILLS=true
- CREATE_ADMIN_USER=true
- ADMIN_NAME=Restarters Admin
- ADMIN_EMAIL=admin@example.com
- ADMIN_PASSWORD=password
- ADMIN_ROLE=2 # 2 is the Administrator Role ID
- DB_HOST=restarters_db_prod
- DB_PORT=3306
- DB_DATABASE=restarters_prod
- DB_USERNAME=restarters_user
- DB_PASSWORD=restarters_pass
volumes:
# Only mount the .env file
- ./.env.prod:/var/www/.env:ro
healthcheck:
test: ["CMD-SHELL", "/usr/local/bin/healthcheck.sh"]
interval: 10s
timeout: 5s
retries: 3
networks:
- app-network-prod
# Production MySQL database
restarters_db_prod:
image: mysql:8.0.42
container_name: restarters_db_prod
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: s3cr3t_prod
MYSQL_DATABASE: restarters_prod
MYSQL_USER: restarters_user
MYSQL_PASSWORD: restarters_pass
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-ps3cr3t_prod"]
start_period: 10s
interval: 10s
timeout: 5s
retries: 10
volumes:
- dbdata_prod:/var/lib/mysql
networks:
- app-network-prod
networks:
app-network-prod:
driver: bridge
volumes:
dbdata_prod:
driver: local