-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
executable file
·122 lines (116 loc) · 3.07 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
version: "3.7"
services:
db:
image: mysql:latest
container_name: ${DOCKER_PREFIX}-db
# restart: unless-stopped
ports:
- ${DB_PORT}:3306
environment:
MYSQL_DATABASE: ${DB_DATABASE}
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
MYSQL_PASSWORD: ${DB_PASSWORD}
MYSQL_USER: ${DB_USERNAME}
SERVICE_TAGS: dev
SERVICE_NAME: mysql
volumes:
- ./mysql/my.cnf:/etc/mysql/my.cnf
- ./mysql/docker-entrypoint-initdb.d/:/docker-entrypoint-initdb.d/
networks:
- app-network
cache:
image: redis:6.2-alpine
restart: always
container_name: ${DOCKER_PREFIX}-cache
ports:
- '6379:6379'
command: redis-server --save 20 1 --loglevel warning
environment:
- ALLOW_EMPTY_PASSWORD=yes
volumes:
- cache:/data
networks:
- app-network
mailhog:
image: mailhog/mailhog:latest
container_name: ${DOCKER_PREFIX}-mailhog
logging:
driver: none
ports:
- ${MAILHOG_HTTP_PORT}:${MAILHOG_HTTP_PORT} #http port
- ${MAILHOG_SMTP_PORT}:${MAILHOG_SMTP_PORT} #smtp port
networks:
- app-network
nginx:
image: nginx:alpine
container_name: ${DOCKER_PREFIX}-nginx
restart: unless-stopped
ports:
- ${NGINX_PORT}:${NGINX_PORT}
volumes:
- ./${PROJECT_DIR_PATH}:/var/www/${PROJECT_DIR}
- ./nginx/conf.d/:/etc/nginx/conf.d/
networks:
- app-network
app:
build:
args:
user: www
uid: 1000
PHP_VERSION: ${PHP_VERSION}
PROJECT_DIR: ${PROJECT_DIR}
NODE_VERSION: ${NODE_VERSION}
# context: ./${PROJECT_DIR_PATH}
dockerfile: Dockerfile
context: .
depends_on:
- db
- mailhog
- nginx
- cache
image: ${DOCKER_PREFIX}-app-${PHP_VERSION}
container_name: ${DOCKER_PREFIX}-app
restart: unless-stopped
working_dir: /var/www/${PROJECT_DIR}
environment:
APP_KEY: ${APP_KEY}
APP_DEBUG: "true"
APP_NAME: ${APP_NAME}
DB_DATABASE: ${DB_DATABASE}
DB_USERNAME: ${DB_USERNAME}
DB_PASSWORD: ${DB_PASSWORD}
MAIL_MAILER: smtp
MAIL_DRIVER: smtp
MAIL_HOST: mailhog
MAIL_PORT: 1025
MAIL_USERNAME: null
MAIL_PASSWORD: null
MAIL_ENCRYPTION: null
MAIL_FROM_ADDRESS: null
MAIL_FROM_NAME: ""
SESSION_SECURE_COOKIE: "false"
SMTP_HOST: "smtp.mailtrap.io"
SMTP_PORT: "465"
SMTP_USE_AUTHENTICATION: "true"
SMTP_SECURE_TRANSPORT: "TLS"
SMTP_USERNAME: ${MAILTRAP_USERNAME}
SMTP_PASSWORD: ${MAILTRAP_PASSWORD}
SMTP_DEBUG: "false"
HOST_HOSTNAME: ${HOSTNAME}
VIRTUAL_HOST: "${PROJECT_DIR}.local"
VIRTUAL_PORT: 3000
REDIS_HOST: cache
REDIS_PORT: 6379
volumes:
- ./${PROJECT_DIR_PATH}:/var/www/${PROJECT_DIR}
- ./supervisord:/etc/supervisor/conf.d/
- ./php/local.ini:/usr/local/etc/php/conf.d/local.ini
- ./php/xdebug.ini:/usr/local/etc/php/conf.d/xdebug.ini
networks:
- app-network
networks:
app-network:
driver: bridge
volumes:
cache:
driver: local