-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.stack.yml
More file actions
108 lines (100 loc) · 2.78 KB
/
docker-compose.stack.yml
File metadata and controls
108 lines (100 loc) · 2.78 KB
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
# Full stack override: build mage-api from source instead of using pre-built image
#
# Prerequisites:
# - mage-api at ../mage-api (sibling directory)
# - .env.docker in mage-app (see .env.docker.example)
#
# Run:
# cd mage-app
# docker compose -f docker-compose.yml -f docker-compose.stack.yml up -d
#
# The mage-api will be built from ../mage-api. Set MAGE_API_SOURCE to override:
# MAGE_API_SOURCE=/path/to/mage-api docker compose -f docker-compose.yml -f docker-compose.stack.yml up -d
#
# Mage-api runs as app+nginx (same as mage-api's own docker-compose).
# Mage-app's nginx proxies /mage-api/ to mage-api-nginx. We add mage-api-nginx
# with network alias "mage-api" so the existing proxy config works.
version: "3.9"
services:
app:
depends_on:
- api
- mage-api-nginx
# Replace mage-api image with build from source (PHP-FPM container)
mage-api:
build:
context: ${MAGE_API_SOURCE:-../mage-api}
dockerfile: Dockerfile
args:
user: www-data
uid: ${UID:-1000}
image: mage-api:local
container_name: mage-api
hostname: mage-api-app
environment:
APP_ENV: local
APP_DEBUG: "true"
APP_URL: http://localhost
DB_HOST: mysql
DB_PORT: 3306
DB_DATABASE: ${MYSQL_DATABASE:-mage_api}
DB_USERNAME: ${MYSQL_USER:-mage_api}
DB_PASSWORD: ${MYSQL_PASSWORD:-secret}
REDIS_HOST: redis
REDIS_PORT: 6379
QUEUE_CONNECTION: sync
volumes:
- ${MAGE_API_SOURCE:-../mage-api}:/var/www
- mage-api-filestorage:/var/www/filestorage
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_started
networks:
mage:
aliases:
- mage-api-app.localhost
mage-api-nginx:
image: nginx:alpine
container_name: mage-api-nginx
hostname: mage-api
volumes:
- ${MAGE_API_SOURCE:-../mage-api}:/var/www
- ./docker/mage-api-app.stack.conf:/etc/nginx/conf.d/app.conf:ro
depends_on:
- mage-api
networks:
mage:
aliases:
- mage-api.localhost
redis:
image: redis:7-alpine
container_name: mage-redis
hostname: redis
networks:
mage:
aliases:
- redis.localhost
nginx:
depends_on:
- app
- api
- mage-api-nginx
volumes:
- ./docker/nginx.stack.conf:/etc/nginx/nginx.conf:ro
mysql:
environment:
MYSQL_DATABASE: ${MYSQL_DATABASE:-mage_api}
MYSQL_USER: ${MYSQL_USER:-mage_api}
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-secret}
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-rootsecret}
volumes:
- mysql_data:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 5s
timeout: 5s
retries: 10
volumes:
mage-api-filestorage: