forked from opensourcepos/opensourcepos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.nginx.yml
104 lines (97 loc) · 2.8 KB
/
docker-compose.nginx.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
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
version: '3.4'
volumes:
uploads:
driver: local
logs:
driver: local
mysql:
driver: local
networks:
app_net:
db_net:
services:
ospos:
image: jekkos/opensourcepos:3.3.8
restart: always
depends_on:
- mysql
expose:
- "80"
networks:
- app_net
- db_net
volumes:
- uploads:/app/public/uploads
- logs:/app/application/logs
environment:
- CI_ENV=${OSPOS_CI_ENV}
- FORCE_HTTPS=true
- PHP_TIMEZONE=UTC
- MYSQL_USERNAME=${OSPOS_MYSQL_USERNAME}
- MYSQL_PASSWORD=${OSPOS_MYSQL_PASSWORD}
- MYSQL_DB_NAME=ospos
- MYSQL_HOST_NAME=mysql
mysql:
image: mariadb:10.5
container_name: mysql
restart: always
expose:
- "3306"
networks:
- db_net
volumes:
- ./database/database.sql:/docker-entrypoint-initdb.d/database.sql
- mysql:/var/lib/mysql:rw
environment:
- MYSQL_ROOT_PASSWORD=${OSPOS_MYSQL_ROOT_PASSWORD}
- MYSQL_DATABASE=ospos
- MYSQL_USER=${OSPOS_MYSQL_USERNAME}
- MYSQL_PASSWORD=${OSPOS_MYSQL_PASSWORD}
phpmyadmin:
image: phpmyadmin/phpmyadmin
container_name: phpmyadmin
restart: always
depends_on:
- mysql
expose:
- "80"
networks:
- app_net
- db_net
environment:
- MYSQL_USERNAME=${OSPOS_MYSQL_USERNAME}
- MYSQL_ROOT_PASSWORD=${OSPOS_MYSQL_ROOT_PASSWORD}
- PMA_HOST=mysql
nginx:
image: nginx:1.19-alpine
container_name: nginx
restart: always
depends_on:
- ospos
- phpmyadmin
- certbot
volumes:
- ./docker/data/nginx/nginx.tmpl:/etc/nginx/nginx.tmpl:ro
- ./docker/data/nginx/error_log.log:/etc/nginx/error_log.log
- ./docker/data/certbot/conf:/etc/letsencrypt:ro
- ./docker/data/certbot/www:/var/www/certbot:ro
ports:
- "80:80"
- "443:443"
- "8000:8000"
networks:
- app_net
environment:
- WEB_DOMAIN=${OSPOS_DOMAIN_NAME}
- ESC=$$
command: "/bin/sh -c 'envsubst < /etc/nginx/nginx.tmpl > /etc/nginx/nginx.conf & while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
certbot:
image: certbot/certbot
container_name: certbot
restart: always
volumes:
- ./docker/data/certbot/conf:/etc/letsencrypt
- ./docker/data/certbot/www:/var/www/certbot
networks:
- app_net
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"