-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yaml
126 lines (118 loc) · 3.54 KB
/
docker-compose.yaml
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
---
services:
app:
image: wayofdev/php-dev:8.3-fpm-alpine-latest
container_name: ${COMPOSE_PROJECT_NAME}-app
restart: on-failure
networks:
- default
- shared
depends_on:
- database
links:
- database
external_links:
- 'rabbitmq.${COMPOSE_PROJECT_NAME}.alias:rabbitmq'
volumes:
- ./.github/assets:/assets:rw,cached
- ./app:/app:rw,cached
- ./.env:/app/.env
- ~/.composer:/.composer
# SSH agent forwarding on unix sockets won't work
# https://medium.com/@vanuan/ssh-and-docker-compose-7bce10b67765
# Reverting to mounting the ssh folder
- ~/.ssh:/home/www-data/.ssh
environment:
FAKETIME: '+2h'
XDEBUG_MODE: '${XDEBUG_MODE:-off}'
PHIVE_HOME: /app/.phive
dns:
8.8.8.8
extra_hosts:
- 'host.docker.internal:host-gateway'
web:
image: wayofdev/nginx:k8s-alpine-latest
container_name: ${COMPOSE_PROJECT_NAME}-web
restart: on-failure
networks:
- default
- shared
depends_on:
- app
links:
- app
volumes:
- ./app:/app:rw,cached
- ./.env:/app/.env
labels:
- traefik.enable=true
- traefik.http.routers.api-${COMPOSE_PROJECT_NAME}-secure.rule=Host(`api.${COMPOSE_PROJECT_NAME}.docker`)
- traefik.http.routers.api-${COMPOSE_PROJECT_NAME}-secure.entrypoints=websecure
- traefik.http.routers.api-${COMPOSE_PROJECT_NAME}-secure.tls=true
- traefik.http.services.api-${COMPOSE_PROJECT_NAME}-secure.loadbalancer.server.port=8880
- traefik.docker.network=network.${SHARED_SERVICES_NAMESPACE}
database:
image: wayofdev/postgres:15-alpine-latest
container_name: ${COMPOSE_PROJECT_NAME}-database
restart: on-failure
networks:
- default
- shared
ports:
- '${DB_FORWARD_PORT:-5432}:5432'
environment:
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: ${DB_DATABASE}
volumes:
- database-data:/var/lib/postgresql/data:cached
healthcheck:
test: ['CMD', 'pg_isready', '-U', '${DB_USERNAME:-cycle}', '-d', '${DB_DATABASE:-default}']
interval: 3s
timeout: 1s
retries: 10
redis:
image: redis:7.2.5-alpine3.19
container_name: ${COMPOSE_PROJECT_NAME}-redis
restart: on-failure
networks:
- default
- shared
ports:
- '${REDIS_FORWARD_PORT:-6379}:6379'
volumes:
- redis-data:/data:cached
mail:
image: axllent/mailpit:latest
container_name: ${COMPOSE_PROJECT_NAME}-mail
restart: on-failure
networks:
default:
shared:
aliases:
- mail.${COMPOSE_PROJECT_NAME}.alias
ports:
- "${FORWARD_MAILPIT_PORT:-1025}:1025"
volumes:
- mail-data:/data
labels:
- traefik.enable=true
- traefik.http.routers.mail-${COMPOSE_PROJECT_NAME}-secure.rule=Host(`mail.${COMPOSE_PROJECT_NAME}.docker`)
- traefik.http.routers.mail-${COMPOSE_PROJECT_NAME}-secure.entrypoints=websecure
- traefik.http.routers.mail-${COMPOSE_PROJECT_NAME}-secure.tls=true
- traefik.http.services.mail-${COMPOSE_PROJECT_NAME}-secure.loadbalancer.server.port=8025
- traefik.docker.network=network.${SHARED_SERVICES_NAMESPACE}
volumes:
database-data:
name: ${COMPOSE_PROJECT_NAME}-database-data
redis-data:
name: ${COMPOSE_PROJECT_NAME}-redis-data
mail-data:
name: ${COMPOSE_PROJECT_NAME}-mail-data
networks:
shared:
external: true
name: network.${SHARED_SERVICES_NAMESPACE}
default:
name: project.${COMPOSE_PROJECT_NAME}
...