Skip to content
Permalink
1.12
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time
services:
php:
container_name: php
build:
context: .
target: sylius_php_prod
depends_on:
- mysql
environment:
DATABASE_URL: mysql://sylius:${MYSQL_PASSWORD}@mysql/sylius_prod
MAILER_URL: smtp://localhost
PHP_DATE_TIMEZONE: ${PHP_DATE_TIMEZONE:-UTC}
APP_ENV: prod
APP_DEBUG: 0
APP_SECRET: EDITME
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
networks:
- sylius
mysql:
container_name: mysql
# in production, we may want to use a managed database service
image: mysql:5.7 # Sylius is fully working on mysql 8.0 version
environment:
MYSQL_RANDOM_ROOT_PASSWORD: true
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
networks:
- sylius
nginx:
container_name: nginx
# in production, we may want to use a static website hosting service
build:
context: .
target: sylius_nginx
depends_on:
- php
volumes:
# use a bind-mounted host directory, as we want to keep the media
- ./public/media:/srv/sylius/public/media:ro
networks:
- sylius
ports:
- 80:80
networks:
sylius:
driver: bridge