-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
83 lines (82 loc) · 2.15 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
version: "3.8"
services:
# Application
app:
hostname: transactions-api
container_name: transactions-api
build:
context: ./docker/services/app
dockerfile: app.dockerfile
working_dir: /var/www
volumes:
- ./:/var/www
networks:
- app-network
# Web Server
web:
hostname: transactions-api-web
container_name: transactions-api-web
build:
context: ./docker/services/web
dockerfile: web.dockerfile
working_dir: /var/www
volumes:
- ./:/var/www
ports:
- "80:80"
networks:
- app-network
# Database
database:
hostname: transactions-api-database
container_name: transactions-api-database
image: mysql:8.0.25
volumes:
- ./docker/volumes/mysql:/var/lib/mysql
environment:
MYSQL_DATABASE: ${DB_DATABASE}
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
MYSQL_PASSWORD: ${DB_PASSWORD}
MYSQL_USER: ${DB_USERNAME}
MYSQL_ALLOW_EMPTY_PASSWORD: true
ports:
- "3306:3306"
networks:
- app-network
# Caching
redis:
hostname: transactions-api-redis
container_name: transactions-api-redis
image: redis:alpine
volumes:
- ./docker/volumes/redis:/data
ports:
- '${FORWARD_REDIS_PORT:-6379}:6379'
healthcheck:
test: ["CMD", "redis-cli", "ping"]
retries: 3
timeout: 5s
networks:
- app-network
# Mailing Server
mailhog:
hostname: transactions-api-mailhog
container_name: transactions-api-mailhog
image: 'mailhog/mailhog:latest'
ports:
- '${FORWARD_MAILHOG_PORT:-1025}:1025'
- '${FORWARD_MAILHOG_DASHBOARD_PORT:-8025}:8025'
networks:
- app-network
networks:
app-network:
driver: bridge
volumes:
app:
driver: local
database:
driver: local
redis:
driver: local
mailhog:
driver: local