-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
79 lines (77 loc) · 2.42 KB
/
docker-compose.yaml
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
version: '2.2'
# Let's build all the services required to run this app (dev version)
# We need -
# MySQL => Database
# Nginx => Web Server
# PHP-FPM => PHP
services:
mysql:
container_name: mysql
image: mysql:8.0.23
command:
- --default-authentication-plugin=mysql_native_password
- --sort_buffer_size=1073741824
volumes:
- ./docker/mysql:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: symfony
MYSQL_DATABASE: symfony # Database will be created on start
MYSQL_USER: symfony # Password for MySQL User.
MYSQL_PASSWORD: symfony
ports:
- "3306:3306"
php:
container_name: php
# user: 1000:1000 # rw access
build:
context: .
dockerfile: ./docker/php/Dockerfile
volumes:
- .:/var/www/html
- ./docker/php/xdebug.ini:/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
- ./docker/php/php.ini:/usr/local/etc/php/conf.d/custom.ini
environment:
#DATABASE_URL: mysql://symfony:symfony@mysql:3306/symfony?serverVersion=5.7
#APP_ENV: dev # For debugging purpose we built it as a dev version
PHP_IDE_CONFIG: serverName=symfony-php # This needs to be in under PHP -> Servers -> Name (Set to symfony-php)
extra_hosts:
- "host.docker.internal:host-gateway"
links:
- mysql
depends_on:
- mysql
nginx:
container_name: nginx
volumes:
- .:/var/www/html
build:
context: .
dockerfile: ./docker/nginx/Dockerfile
ports:
- "80:80" # Webserver will run on http://localhost
depends_on:
- php # Web App service must be running
- mysql # DB must be ready
encore:
image: node:alpine
user: 1000:1000
volumes:
- .:/app
working_dir: /app
###> doctrine/doctrine-bundle ###
database:
image: postgres:${POSTGRES_VERSION:-15}-alpine
environment:
POSTGRES_DB: ${POSTGRES_DB:-app}
# You should definitely change the password in production
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-!ChangeMe!}
POSTGRES_USER: ${POSTGRES_USER:-app}
volumes:
- database_data:/var/lib/postgresql/data:rw
# You may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!
# - ./docker/db/data:/var/lib/postgresql/data:rw
###< doctrine/doctrine-bundle ###
volumes:
###> doctrine/doctrine-bundle ###
database_data:
###< doctrine/doctrine-bundle ###