forked from phpvms/phpvms
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.example.yml
More file actions
133 lines (126 loc) · 3.5 KB
/
docker-compose.example.yml
File metadata and controls
133 lines (126 loc) · 3.5 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# This Docker Compose file is an example of what a setup for running phpVMS in production could look like.
# It is based on the image created in the Dockerfile. You can find more examples in phpvms' documentation.
services:
app:
container_name: phpvms-app
user: "${WWWUSER:-1000}:${WWWGROUP:-1000}"
image: ghcr.io/phpvms/phpvms:main
hostname: app
restart: unless-stopped
environment:
PHP_OPCACHE_ENABLE: 1
# some basic laravel stuff
AUTORUN_ENABLED: 1
env_file: .env
volumes:
- phpvms_assets:/var/www/html/public/build:rw
- ./modules:/var/www/html/modules:ro
- phpvms_uploads:/var/www/html/public/uploads:rw
- phpvms_storage:/var/www/html/storage:rw
depends_on:
- caddy
- mariadb
- redis
networks:
- phpvms
task:
container_name: phpvms-task
user: "${WWWUSER:-1000}:${WWWGROUP:-1000}"
image: ghcr.io/phpvms/phpvms:main
restart: unless-stopped
command: ["php", "/var/www/html/artisan", "schedule:work"]
environment:
PHP_OPCACHE_ENABLE: 1
healthcheck:
# This is our native healthcheck script for the scheduler
test: [ "CMD", "healthcheck-schedule" ]
start_period: 10s
env_file: .env
volumes:
- ./modules:/var/www/html/modules:ro
- phpvms_uploads:/var/www/html/public/uploads:rw
- phpvms_storage:/var/www/html/storage:rw
networks:
- phpvms
queue:
container_name: phpvms-queue
user: "${WWWUSER:-1000}:${WWWGROUP:-1000}"
image: ghcr.io/phpvms/phpvms:main
restart: unless-stopped
command: [ "php", "/var/www/html/artisan", "queue:work", "--tries=3" ]
environment:
PHP_OPCACHE_ENABLE: 1
healthcheck:
# This is our native healthcheck script for the queue
test: [ "CMD", "healthcheck-queue" ]
start_period: 10s
env_file: .env
volumes:
- ./modules:/var/www/html/modules:ro
- phpvms_uploads:/var/www/html/public/uploads:rw
- phpvms_storage:/var/www/html/storage:rw
networks:
- phpvms
caddy:
container_name: phpvms-caddy
image: caddy:2
restart: unless-stopped
env_file: .env
ports:
- "${FORWARD_HTTP_PORT:-80}:80"
- "${FORWARD_HTTPS_PORT:-443}:443"
volumes:
- ./public/:/var/www/html/public
- phpvms_assets:/var/www/html/public/build
- ./resources/docker/Caddyfile:/etc/caddy/Caddyfile
- caddy_config:/config
- caddy_data:/data
networks:
- default
- phpvms
mariadb:
container_name: phpvms-mariadb
image: mariadb:11
restart: unless-stopped
# If someone need to access db from the outside
ports:
- '${FORWARD_DB_PORT:-3306}:3306'
environment:
MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}'
MYSQL_DATABASE: '${DB_DATABASE}'
MYSQL_USER: '${DB_USERNAME}'
MYSQL_PASSWORD: '${DB_PASSWORD}'
MYSQL_ALLOW_EMPTY_PASSWORD: 'no'
volumes:
- mariadb:/var/lib/mysql
networks:
- phpvms
healthcheck:
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
start_period: 10s
interval: 10s
timeout: 5s
retries: 3
redis:
container_name: phpvms-redis
image: redis:alpine
restart: unless-stopped
volumes:
- redis:/data
networks:
- phpvms
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
retries: 3
timeout: 5s
volumes:
caddy_data:
caddy_config:
mariadb:
phpvms_storage:
phpvms_uploads:
phpvms_assets:
redis:
networks:
phpvms:
driver: bridge