Skip to content

Commit 45aaa40

Browse files
committed
Add base doc for Docker install
1 parent 9ef559d commit 45aaa40

File tree

2 files changed

+138
-0
lines changed

2 files changed

+138
-0
lines changed

docs/installation/docker.md

+137
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
---
2+
id: docker
3+
title: Installing with Docker
4+
---
5+
6+
phpVMS includes a `docker-compose.dev.yml` which is used by Laravel Sail. This works great for local development. For production, a sample `docker-compose.yml` is included, with a few points below:
7+
8+
```yml
9+
app:
10+
container_name: phpvms-app
11+
user: "${WWWUSER:-1000}:${WWWGROUP:-1000}"
12+
image: phpvms:app
13+
build:
14+
context: .
15+
args:
16+
WWWUSER: ${WWWUSER:-1000}
17+
WWWGROUP: ${WWWGROUP:-1000}
18+
restart: unless-stopped
19+
environment:
20+
PHP_OPCACHE_ENABLE: 1
21+
# some basic laravel stuff
22+
AUTORUN_ENABLED: true
23+
env_file: .env
24+
volumes:
25+
- ./modules:/var/www/html/modules:ro
26+
- ./public/uploads:/var/www/html/public/uploads:rw
27+
- ./storage:/var/www/html/storage:rw
28+
depends_on:
29+
- caddy
30+
- mariadb
31+
- redis
32+
networks:
33+
- phpvms
34+
35+
task:
36+
container_name: phpvms-task
37+
user: "${WWWUSER:-1000}:${WWWGROUP:-1000}"
38+
image: phpvms:app
39+
restart: unless-stopped
40+
command: ["php", "/var/www/html/artisan", "schedule:work"]
41+
environment:
42+
PHP_OPCACHE_ENABLE: 1
43+
healthcheck:
44+
# This is our native healthcheck script for the scheduler
45+
test: [ "CMD", "healthcheck-schedule" ]
46+
start_period: 10s
47+
env_file: .env
48+
volumes:
49+
- ./modules:/var/www/html/modules:ro
50+
- ./public/uploads:/var/www/html/public/uploads:rw
51+
- ./storage:/var/www/html/storage:rw
52+
networks:
53+
- phpvms
54+
55+
queue:
56+
container_name: phpvms-queue
57+
user: "${WWWUSER:-1000}:${WWWGROUP:-1000}"
58+
image: phpvms:app
59+
restart: unless-stopped
60+
command: [ "php", "/var/www/html/artisan", "queue:work", "--tries=3" ]
61+
environment:
62+
PHP_OPCACHE_ENABLE: 1
63+
healthcheck:
64+
# This is our native healthcheck script for the queue
65+
test: [ "CMD", "healthcheck-queue" ]
66+
start_period: 10s
67+
env_file: .env
68+
volumes:
69+
- ./modules:/var/www/html/modules:ro
70+
- ./public/uploads:/var/www/html/public/uploads:rw
71+
- ./storage:/var/www/html/storage:rw
72+
networks:
73+
- phpvms
74+
75+
caddy:
76+
container_name: phpvms-caddy
77+
image: caddy:2
78+
restart: unless-stopped
79+
env_file: .env
80+
ports:
81+
- "${FORWARD_HTTP_PORT:-80}:80"
82+
- "${FORWARD_HTTPS_PORT:-443}:443"
83+
volumes:
84+
- ./public/:/var/www/html/public
85+
- ./resources/docker/Caddyfile:/etc/caddy/Caddyfile
86+
- caddy_config:/config
87+
- caddy_data:/data
88+
networks:
89+
- phpvms
90+
91+
mariadb:
92+
container_name: phpvms-mariadb
93+
image: mariadb:11
94+
restart: unless-stopped
95+
# If someone need to access db from the outside
96+
ports:
97+
- '${FORWARD_DB_PORT:-3306}:3306'
98+
environment:
99+
MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}'
100+
MYSQL_DATABASE: '${DB_DATABASE}'
101+
MYSQL_USER: '${DB_USERNAME}'
102+
MYSQL_PASSWORD: '${DB_PASSWORD}'
103+
MYSQL_ALLOW_EMPTY_PASSWORD: 'no'
104+
volumes:
105+
- mariadb:/var/lib/mysql
106+
networks:
107+
- phpvms
108+
healthcheck:
109+
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
110+
start_period: 10s
111+
interval: 10s
112+
timeout: 5s
113+
retries: 3
114+
115+
redis:
116+
container_name: phpvms-redis
117+
image: redis:alpine
118+
restart: unless-stopped
119+
volumes:
120+
- redis:/data
121+
networks:
122+
- phpvms
123+
healthcheck:
124+
test: [ "CMD", "redis-cli", "ping" ]
125+
retries: 3
126+
timeout: 5s
127+
128+
volumes:
129+
caddy_data:
130+
caddy_config:
131+
mariadb:
132+
redis:
133+
134+
networks:
135+
phpvms:
136+
driver: bridge
137+
```

sidebars.js

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ module.exports = {
2121
'installation/cron',
2222
'installation/importing',
2323
'installation/updating',
24+
'installation/docker',
2425
'installation/issues',
2526
]
2627
},

0 commit comments

Comments
 (0)