-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
46 lines (42 loc) · 1.15 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
version: '3'
# from: https://www.digitalocean.com/community/tutorials/how-to-set-up-laravel-nginx-and-mysql-with-docker-compose
services:
app:
build:
context: .
dockerfile: ./docker-compose/dev/app/Dockerfile
image: digitalocean.com/php
volumes:
- ./:/var/www
- type: bind
source: ./php/local.ini
target: /usr/local/etc/php/conf.d/local.ini
webserver:
image: nginx:alpine
ports:
- "8080:80"
volumes:
- ./:/var/www
- ./docker-compose/dev/nginx/conf.d/:/etc/nginx/conf.d/
db:
image: mariadb
environment:
MARIADB_ROOT_PASSWORD: sdash
MARIADB_DATABASE: laravel
MARIADB_USER: laraveluser
MARIADB_PASSWORD: dbpass
volumes:
- dbdata:/var/lib/mysql
- ./docker-compose/dev/mysql/my.cnf:/etc/mysql/my.cnf
frontend:
build:
context: .
dockerfile: ./docker-compose/dev/frontend/Dockerfile
volumes:
- ./:/app
# anonymous volume here; bind mapping to ./node_modules does not work! Permission issue bc app is user www?
- /app/node_modules
command: ['npm', 'run', 'watch']
volumes:
dbdata:
driver: local