-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathdocker-compose.yml
57 lines (53 loc) · 1.53 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
version: '3.7'
networks:
openchat:
driver: bridge
volumes:
# Mount your current directory as a shared volume, but mount a persistent docker volume in place of local node_modules and vendor directories.
# This will allow node_modules and vendor to persist between `docker-compose up` runs.
vendor:
node_modules:
db_data:
services:
# ========================
# Database
# ========================
db:
image: mysql:5.7
container_name: oc-db
restart: unless-stopped
ports:
- 33060:3306
environment:
# `secret` as password is used only in local development.
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
# The application db user can't be named `root`.
MYSQL_USER: ${DB_USER} # Requires that `DB_USER` has been defined.
MYSQL_PASSWORD: ${DB_PASSWORD} # Requires that `DB_PASSWORD` has been defined.
MYSQL_DATABASE: ${DB_NAME} # Requires that `DB_NAME` has been defined.
volumes:
- db_data:/var/lib/mysql
- ${PWD}/sql/:/docker-entrypoint-initdb.d/
networks:
- openchat
# ========================
# Application
# ========================
app:
image: app
container_name: oc-app
build:
context: .
volumes:
- ${PWD}:/var/www/html
- ${PWD}/docker/config/php/php.ini:/usr/local/etc/php/conf.d/php.ini:ro
- vendor:/var/www/html/vendor
- node_modules:/var/www/html/node_modules
depends_on:
- db
working_dir: /var/www/html
ports:
- 8080:8080
- 8888:8888
networks:
- openchat