-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
executable file
·125 lines (117 loc) · 3.04 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
version: "3.2"
#Docker Networks
networks:
project-network:
driver: bridge
ipam:
driver: default
config:
- subnet: 192.168.220.0/28
#Volumes
volumes:
redis-data:
postgresdb-data:
services:
#PHP Service
&app-service app:
build:
context: ./docker/php
args:
CURRENT_USER: ${CURRENT_USER:-1000:1000}
image: ${COMPOSE_PROJECT_NAME}_app
container_name: ${COMPOSE_PROJECT_NAME}_app_1
environment:
SERVICE_NAME: app
SERVICE_TAGS: dev
REDIS_HOST: redis
REDIS_PORT: &redis-port 6379
DB_HOST: postgresdb
DB_PORT: &postgresdb-port 5432
DB_DATABASE: &postgresdb-db-name app
DB_USERNAME: &postgresdb-username app
DB_PASSWORD: &postgresdb-password secret
SCHEDULE_PERIOD: 60
APP_DEBUG: 'true'
XDEBUG_CONFIG: "remote_host=192.168.220.1 remote_enable=1"
PHP_IDE_CONFIG: "serverName=Docker"
working_dir: /var/www
volumes:
- ./:/var/www
- ./docker/php/local.ini:/usr/local/etc/php/conf.d/local.ini
depends_on:
- redis
- postgresdb
networks:
- project-network
#Nginx Service
web:
build:
context: ./docker/nginx
image: ${COMPOSE_PROJECT_NAME}_nginx
container_name: ${COMPOSE_PROJECT_NAME}_nginx_1
ports:
- "8089:80"
volumes:
- ./public:/var/www/html/public
- ./storage:/var/www/html/storage
- ./docker/nginx/conf.d/default.conf:/etc/nginx/conf.d/default.conf
environment:
VIRTUAL_HOST: ${VIRTUAL_HOST}
VIRTUAL_PORT: 8089
working_dir: /var/www
depends_on:
- *app-service
links:
- 'app:app'
networks:
- project-network
#DB Service
postgresdb:
build:
context: ./docker/postgresdb
args:
CURRENT_USER: ${CURRENT_USER:-1000:1000}
image: ${COMPOSE_PROJECT_NAME}_postgresdb
container_name: ${COMPOSE_PROJECT_NAME}_postgresdb_1
volumes:
- postgresdb-data:/var/lib/postgresql/data:rw
environment:
POSTGRES_USER: *postgresdb-username
POSTGRES_DB: *postgresdb-db-name
POSTGRES_PASSWORD: *postgresdb-password
ports: [*postgresdb-port, '54322:5432']
networks:
- project-network
node:
build:
context: ./
dockerfile: docker/node/Dockerfile
image: node
container_name: ${COMPOSE_PROJECT_NAME}_node_1
ports:
- "3000:3000"
tty: true
volumes:
- ./:/var/www
networks:
- project-network
redis:
image: redis:5.0.7-alpine
container_name: ${COMPOSE_PROJECT_NAME}_redis_1
restart: always
command: redis-server
volumes:
- redis-data:/data:rw
ports: [*redis-port, '16379:6379'] # Port 16379 for connecting from localhost
networks:
- project-network
redis-commander: # <https://github.com/joeferner/redis-commander>
image: rediscommander/redis-commander:latest
environment:
REDIS_HOSTS: 'default:redis:6379:0,cache:redis:6379:1,sessions:redis:6379:2'
ports:
- '13307:8081'
depends_on:
- redis
networks:
- project-network