-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
50 lines (49 loc) · 1.51 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
# 1. Use dockercompose build
# Note when building a image on windows , you must switch to linux containers in docker desktop
# Then start the build container with the configurations
# 2. docker-compose --env-file ./config/.env.dev up
version: '3.7'
services:
db:
build: build/database
# If mysql then create folder in root and comment out line below
#image: mysql/mysql-server:latest
restart: on-failure
environment:
- MYSQL_DATABASE=${DATABASE_NAME}
- MYSQL_USER=${DATABASE_USER}
- MYSQL_PASSWORD=${DATABASE_PASSWORD}
- MYSQL_ROOT_PASSWORD=${DATABASE_ROOT_PASSWORD}
ports:
- "${DATABASE_PORT}:3306"
php:
build:
#build/php
context: .
dockerfile: build/php/Dockerfile
restart: on-failure
user: ${LOCAL_USER}
depends_on:
- db
environment:
- APP_ENV=${APP_ENV}
- APP_SECRET=${APP_SECRET}
- DATABASE_URL=mysql://${DATABASE_USER}:${DATABASE_PASSWORD}@db:3306/${DATABASE_NAME}?serverVersion=5.7
# Need to link to maria
links:
- db
web:
build: build/nginx
restart: on-failure
ports:
- '${NGINX_PORT}:80'
depends_on:
- php
- db
links:
- php
# Symfony commands for building your application can also be run
# docker-compose exec php composer install
# docker-compose exec php php bin/console doctrine:schema:create
# docker-compose exec php php bin/console doctrine:fixtures:load
# docker-compose exec php php bin/console assets:install –symlink public/