-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
76 lines (70 loc) · 2.02 KB
/
docker-compose.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
version: '3.9'
networks:
backend:
npm:
external: true
name: npm
services:
php:
container_name: ${COMPOSE_PROJECT_NAME}_php
restart: unless-stopped
build:
context: .
working_dir: /var/www/html
environment:
COMPOSE_PROJECT_NAME: ${COMPOSE_PROJECT_NAME:-ordersprinterguest}
MYSQL_USER: ${MYSQL_USER:-guestuser}
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-pleaseUseASuperSecurePasswordReplaceMe}
MYSQL_DB: ${MYSQL_DB:-guestdb}
MYSQL_HOST: ${COMPOSE_PROJECT_NAME}_mariadb
CODE: ${CODE:-123456}
DB: ${DB:-mysql}
volumes:
- ./php.ini:/usr/local/etc/php/conf.d/extra-php-config.ini:ro
- ./fpm.conf:/usr/local/etc/php-fpm.d/zz-fpm.conf:ro
- ./ordersprinter-entrypoint:/usr/local/bin/docker-php-entrypoint:ro
- data:/var/www/html
networks:
- backend
nginx:
image: nginx:1.24.0-alpine
container_name: ${COMPOSE_PROJECT_NAME}_nginx
restart: unless-stopped
volumes:
- data:/var/www/html
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
- ./favicon.ico:/favicon.ico:ro
depends_on:
php:
condition: service_started
database:
condition: service_started
networks:
- backend
- npm
database:
# pinned to MariaDB 10.11 LTS
image: mariadb:10.11.5
container_name: ${COMPOSE_PROJECT_NAME}_mariadb
restart: unless-stopped
environment:
MARIADB_AUTO_UPGRADE: 1
MARIADB_DATABASE: ${MYSQL_DB}
MARIADB_USER: ${MYSQL_USER}
MARIADB_PASSWORD: ${MYSQL_PASSWORD}
MARIADB_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
volumes:
- db:/var/lib/mysql
healthcheck:
test: ["CMD-SHELL", "/usr/bin/mariadb --user=$MYSQL_USER --password=$MYSQL_PASSWORD --execute=\"show databases;\""]
start_period: 30s
interval: 30s
timeout: 5s
retries: 5
networks:
- backend
# the command for the DB settings need to be in one single line
command: --innodb-buffer-pool-size=64M --max_allowed_packet=32M
volumes:
data:
db: