-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
executable file
·70 lines (70 loc) · 1.79 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
version: "3.7"
services:
app-api:
build:
context: ./
dockerfile: Dockerfile
env_file:
- .env
image: app
container_name: app-api
restart: unless-stopped
working_dir: /var/www/
command: bash -c "composer install && php artisan migrate && php-fpm"
volumes:
- ./:/var/www
networks:
- app-api
- app-web
depends_on:
app-db :
condition: service_healthy
app-db:
image: mysql:8.0
container_name: app-db
restart: unless-stopped
environment:
MYSQL_DATABASE: ${DB_DATABASE-database}
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD-password}
MYSQL_PASSWORD: ${DB_PASSWORD-password}
MYSQL_USER: ${DB_USERNAME-foulen}
volumes:
- app-db:/var/lib/mysql
ports:
- ${FORWARD_DB_PORT-33066}:3306
networks:
- app-api
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
timeout: 20s
retries: 10
app-web:
image: nginx:alpine
container_name: app-web
restart: unless-stopped
depends_on:
- app-api
ports:
- ${APP_PORT-8000}:80
volumes:
- ./:/var/www
- ./docker/nginx:/etc/nginx/conf.d/
networks:
- app-web
app-mail:
image: mailhog/mailhog
container_name: app-mail
ports:
- ${MAIL_PORT-8003}:1025
- ${MAILHOG_PORT-8100}:8025
networks:
- app-api
networks:
app-api:
driver: bridge
name: app-api
app-web:
driver: bridge
name: app-web
volumes:
app-db: