-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
96 lines (91 loc) · 2.39 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
services:
composer:
image: local/php:php-debian
build:
context: ./.docker/php
target: php-debian
depends_on:
mysql:
condition: service_healthy
environment:
APP_ENV: dev
APP_DEBUG: 1
APP_SECRET: EDITME
DATABASE_URL: "mysql://root:${MYSQL_PASSWORD:-sylius}@mysql/sylius_distroless_%kernel.environment%"
MAILER_URL: smtp://mailhog:1025
PHP_DATE_TIMEZONE: ${PHP_DATE_TIMEZONE:-UTC}
volumes:
- .:/var/www:rw,cached
- ./public:/var/www/public:rw,delegated
- public-media:/var/www/public/media:rw
profiles:
- composer
php:
image: local/php:php-distroless
build:
context: ./.docker/php
target: php-distroless
depends_on:
- mysql
environment:
APP_ENV: dev
APP_DEBUG: 1
APP_SECRET: EDITME
DATABASE_URL: "mysql://root:${MYSQL_PASSWORD:-sylius}@mysql/sylius_distroless_%kernel.environment%"
MAILER_URL: smtp://mailhog:1025
PHP_DATE_TIMEZONE: ${PHP_DATE_TIMEZONE:-UTC}
volumes:
- .:/var/www:rw,cached
- ./public:/var/www/public:rw,delegated
- public-media:/var/www/public/media:rw
mysql:
image: mysql:5.7
platform: linux/amd64
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-sylius}
- MYSQL_DATABASE=sylius
- MYSQL_USER=sylius
- MYSQL_PASSWORD=${MYSQL_PASSWORD:-sylius}
volumes:
- mysql-data:/var/lib/mysql:rw
ports:
- "${MYSQL_PORT:-3306}:3306"
cap_add:
- SYS_NICE # prevent "mbind: Operation not permitted" errors
healthcheck:
test: "/usr/bin/mysql --user=$$MYSQL_USER --password=$$MYSQL_PASSWORD --execute \"SHOW databases;\""
interval: 5s
timeout: 2s
retries: 5
nodejs:
working_dir: /var/www
image: "node:${NODE_VERSION:-16}-alpine"
environment:
GULP_ENV: dev
PHP_HOST: php
PHP_PORT: 9000
entrypoint: [ "/bin/sh","-c" ]
command:
- |
yarn install
yarn build
volumes:
- .:/var/www:rw,cached
- ./public:/var/www/public:rw,delegated
ports:
- "${NODE_PORT:-35729}:35729"
profiles:
- node
nginx:
build:
context: ./.docker/nginx
depends_on:
- php
volumes:
- ./public:/var/www/public:ro
- public-media:/var/www/public/media:ro,nocopy
ports:
- "${HTTP_PORT:-80}:80"
volumes:
mysql-data:
public-media: