-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.prod.yml
42 lines (39 loc) · 1.38 KB
/
docker-compose.prod.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
version: '3.4'
services:
php:
image: quay.io/sylius/php:latest
depends_on:
- mysql
environment:
- APP_ENV=prod
- APP_DEBUG=0
- APP_SECRET=EDITME
- DATABASE_URL=mysql://[email protected]/sylius_%kernel.environment%
- MAILER_URL=smtp://localhost
- PHP_DATE_TIMEZONE=${PHP_DATE_TIMEZONE:-UTC}
volumes:
# use a bind-mounted host directory, as we want to keep the sessions
- ./var/sessions:/srv/sylius/var/sessions:rw
# use a bind-mounted host directory, as we want to keep the media
- ./public/media:/srv/sylius/public/media:rw
mysql:
# in production, we may want to use a managed database service
image: percona:5.7
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:?MYSQL_ROOT_PASSWORD is not set or empty}
- MYSQL_DATABASE=sylius_prod
- MYSQL_USER=sylius
- MYSQL_PASSWORD=${MYSQL_PASSWORD:?MYSQL_PASSWORD is not set or empty}
volumes:
# use a bind-mounted host directory, because we never want to lose our data!
- ./docker/mysql/data:/var/lib/mysql:rw,delegated
nginx:
# in production, we may want to use a static website hosting service
image: quay.io/sylius/nginx:latest
depends_on:
- php
volumes:
# use a bind-mounted host directory, as we want to keep the media
- ./public/media:/srv/sylius/public/media:ro
ports:
- "80:80"