-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
56 lines (52 loc) · 1.46 KB
/
docker-compose.yml
File metadata and controls
56 lines (52 loc) · 1.46 KB
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
# tell docker what version of the docker-compose.yml were using
version: '3'
# define the network
networks:
web-network:
# start the services section
services:
# define the name of our service
# corresponds to the "--name" parameter
docker-nginx:
# define the directory where the build should happened,
# i.e. where the Dockerfile of the service is located
# all paths are relative to the location of docker-compose.yml
build:
context: ./.docker/nginx
# defines the port mapping
# corresponds to the "-p" flag
ports:
- "80:80"
# reserve a tty - otherwise the container shuts down immediately
# corresponds to the "-i" flag
tty: true
# mount the app directory of the host to /var/www in the container
# corresponds to the "-v" option
volumes:
- ./src:/var/www
- ./.docker/nginx/conf.d:/etc/nginx/conf.d
# connect to the network
# corresponds to the "--network" option
networks:
- web-network
docker-php-fpm:
build:
context: ./.docker/php-fpm
tty: true
volumes:
- ./src:/var/www
networks:
- web-network
docker-db:
image: postgres:10.1
restart: always
environment:
- POSTGRES_DB=${DB_NAME}
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASSWORD}
ports:
- 5432:5432
volumes:
- ./.docker/postgres/:/docker-entrypoint-initdb.d/
networks:
- web-network