forked from aschmelyun/docker-compose-laravel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
147 lines (137 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
networks:
mynetwork:
name: ${NETWORK}
services:
app:
build:
context: ./dockerfiles
dockerfile: nginx.dockerfile
args:
- UID=${UID:-1000}
- GID=${GID:-1000}
ports:
- "${WEB_PORT:-80}:80"
- "${WEBS_PORT:-443}:443"
volumes:
- ./src:/var/www/html:delegated
depends_on:
- php
- redis
- mysql
- mailpit
networks:
- mynetwork
mysql:
image: mysql:latest
restart: unless-stopped
tty: true
ports:
- "${MYSQL_PORT:-3306}:3306"
environment:
MYSQL_DATABASE: ${MYSQL_DATABASE:-laravel}
MYSQL_USER: ${MYSQL_USER:-laravel}
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-secret}
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-secret}
SERVICE_TAGS: dev
SERVICE_NAME: mysql
volumes:
- ./mysql:/var/lib/mysql
networks:
- mynetwork
php:
build:
context: ./dockerfiles
dockerfile: php.dockerfile
args:
- UID=${UID:-1000}
- GID=${GID:-1000}
ports:
- "${PHP_PORT:-9000}:9000"
extra_hosts:
- 'host.docker.internal:host-gateway'
volumes:
- ./src:/var/www/html:delegated
networks:
- mynetwork
redis:
image: redis:alpine
restart: unless-stopped
ports:
- "${REDIS_PORT:-6379}:6379"
networks:
- mynetwork
composer:
build:
context: ./dockerfiles
dockerfile: php.dockerfile
args:
- UID=${UID:-1000}
- GID=${GID:-1000}
volumes:
- ./src:/var/www/html
depends_on:
- php
working_dir: /var/www/html/${BRANCH}
entrypoint: [ 'composer', '--ignore-platform-reqs' ]
networks:
- mynetwork
npm:
image: node:current-alpine
volumes:
- ./src:/var/www/html
user: ${UID}
ports:
- "${NPM_PORT_1:-3000}:3000"
- "${NPM_PORT_2:-3001}:3001"
- "${NPM_PORT_3:-5173}:5173"
working_dir: /var/www/html/${BRANCH}
entrypoint: [ 'npm' ]
networks:
- mynetwork
artisan:
build:
context: ./dockerfiles
dockerfile: php.dockerfile
args:
- UID=${UID:-1000}
- GID=${GID:-1000}
volumes:
- ./src:/var/www/html:delegated
depends_on:
- mysql
entrypoint: [ 'php', '/var/www/html/${BRANCH}/artisan' ]
networks:
- mynetwork
mailpit:
image: 'axllent/mailpit:latest'
ports:
- "${MAILPIT_PORT_1:-1089}:1025"
- "${MAILPIT_PORT_2:-8089}:8025"
networks:
- mynetwork
phpmyadmin:
depends_on:
- mysql
image: 'phpmyadmin:latest'
restart: always
ports:
- "${PHPMYADMIN_PORT:-8081}:80"
environment:
PMA_HOST: mysql
MYSQL_ROOT_PASSWORD: secret
networks:
- mynetwork
phpunit:
build:
context: ./dockerfiles
dockerfile: php.dockerfile
args:
- UID=${UID:-1000}
- GID=${GID:-1000}
volumes:
- ./src:/var/www/html:delegated
depends_on:
- mysql
entrypoint: [ 'php', '/var/www/html/${BRANCH}/vendor/bin/phpunit' ]
networks:
- mynetwork