-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
68 lines (50 loc) · 1.34 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
58
59
60
61
62
63
64
65
66
67
# Using version 3.5 of the docker-compose standard
version: "3.5"
# A service is a set of containers balancing the total load
services:
database:
# Name of the container
container_name: yii2-psql
# Use the PostgreSQL image from Alpine Linux as is
image: postgres:alpine
# To restart the container when it crashes
restart: always
# Set the environment variable
env_file:
- config/database.env
# Expose the port 5432 used by postgreSQL
# This port is not exposed to host
expose:
- "5432"
# Mount the volumes on the database container
volumes:
# Mount 'database' as the place where postgreSQL stores all its data
- database:/var/lib/postgresql/data
server:
# Name of the container
container_name: yii2-apache
# Base image to be used
image: pranjaltale16/docker-yii2
# To restart the container when it crashes
restart: always
# Environment file
env_file:
- config/apache.env
# Map 8088 port of host machine to apache
ports:
- "8088:80"
# Mount the volumens on the php container
volumes:
- ./src:/src
- ./config/:/config
- ./scripts:/scripts
# Depends on the services'
depends_on:
- database
links:
- database
volumes:
database:
networks:
default:
name: yii2-default