forked from open-marketplace/open-marketplace
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.prod.yml
110 lines (104 loc) · 3.2 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
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
105
106
107
108
109
110
services:
php:
container_name: php
build:
context: .
target: open_marketplace_php_prod
depends_on:
- migrations
environment:
APP_DEBUG: 0
APP_ENV: prod
APP_SECRET: EDITME
DATABASE_URL: mysql://open_marketplace:${MYSQL_PASSWORD}@mysql/open_marketplace_prod
MAILER_URL: smtp://localhost
MESSENGER_TRANSPORT_DSN: doctrine://default
PHP_DATE_TIMEZONE: ${PHP_DATE_TIMEZONE:-UTC}
volumes:
# use a bind-mounted host directory, as we want to keep the sessions
- ./var/sessions:/srv/open_marketplace/var/sessions:rw
# use a bind-mounted host directory, as we want to keep the media
- ./public/media:/srv/open_marketplace/public/media:rw
networks:
- open_marketplace
cron:
container_name: cron
build:
context: .
target: open_marketplace_cron
depends_on:
- migrations
environment:
APP_ENV: prod
APP_DEBUG: 0
APP_SECRET: EDITME
DATABASE_URL: mysql://open_marketplace:${MYSQL_PASSWORD}@mysql/open_marketplace_prod
PHP_DATE_TIMEZONE: ${PHP_DATE_TIMEZONE:-UTC}
networks:
- open_marketplace
worker:
container_name: worker
command: ["php", "bin/console", "messenger:consume", "main", "catalog_promotion_removal", "--limit=5", "--memory-limit=256M", "--time-limit=600"]
restart: always
build:
context: .
target: open_marketplace_php_prod
depends_on:
- migrations
environment:
APP_ENV: prod
APP_DEBUG: 0
APP_SECRET: EDITME
DATABASE_URL: mysql://open_marketplace:${MYSQL_PASSWORD}@mysql/open_marketplace_prod
MESSENGER_TRANSPORT_DSN: doctrine://default
PHP_DATE_TIMEZONE: ${PHP_DATE_TIMEZONE:-UTC}
networks:
- open_marketplace
migrations:
container_name: migrations
build:
context: .
target: open_marketplace_migrations_prod
depends_on:
- mysql
environment:
APP_ENV: prod
APP_DEBUG: 0
APP_SECRET: EDITME
DATABASE_URL: mysql://open_marketplace:${MYSQL_PASSWORD}@mysql/open_marketplace_prod
LOAD_FIXTURES: ${LOAD_FIXTURES:-0}
PHP_DATE_TIMEZONE: ${PHP_DATE_TIMEZONE:-UTC}
networks:
- open_marketplace
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: open_marketplace_prod
MYSQL_USER: open_marketplace
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:
- open_marketplace
nginx:
container_name: nginx
# in production, we may want to use a static website hosting service
build:
context: .
target: open_marketplace_nginx
depends_on:
- php
volumes:
# use a bind-mounted host directory, as we want to keep the media
- ./public/media:/srv/open_marketplace/public/media:ro
networks:
- open_marketplace
ports:
- 80:80
networks:
open_marketplace:
driver: bridge