-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.prod.yml
150 lines (150 loc) · 4.46 KB
/
docker-compose.prod.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
148
149
150
services:
traefik:
ports:
- target: 80
published: 80
protocol: tcp
mode: host
- target: 443
published: 443
protocol: tcp
mode: host
networks:
- web-public
deploy:
update_config:
parallelism: 1
delay: 5s
order: stop-first
placement:
constraints:
- node.role==manager
volumes:
# Mount the Docker socket as read-only so Traefik can listen to events
- /var/run/docker.sock:/var/run/docker.sock:ro
- certificates:/certificates
configs:
- source: traefik
target: /etc/traefik/traefik.yml
php:
image: ${SPIN_IMAGE_DOCKERFILE_PHP}
environment:
AUTORUN_ENABLED: "true" # 👈 Remove this line if you don't want Laravel Automations
APP_ENV: "${SPIN_DEPLOYMENT_ENVIRONMENT}"
PHP_OPCACHE_ENABLE: "1"
HEALTHCHECK_PATH: "/up"
networks:
- web-public
volumes:
- "storage_private:/var/www/html/storage/app/private/"
- "storage_public:/var/www/html/storage/app/public/"
- "storage_sessions:/var/www/html/storage/framework/sessions"
- "storage_logs:/var/www/html/storage/logs"
- "database_sqlite:/var/www/html/.infrastructure/volume_data/sqlite"
deploy:
replicas: 1
update_config:
failure_action: rollback
parallelism: 1
delay: 5s
order: start-first
rollback_config:
parallelism: 0
order: stop-first
restart_policy:
condition: any
delay: 10s
max_attempts: 3
window: 120s
labels:
- "traefik.enable=true"
- "traefik.http.routers.laravel-web.rule=Host(`${SPIN_APP_DOMAIN}`)"
- "traefik.http.routers.laravel-web.entrypoints=websecure"
- "traefik.http.routers.laravel-web.tls=true"
- "traefik.http.routers.laravel-web.tls.certresolver=letsencryptresolver"
- "traefik.http.services.laravel-web.loadbalancer.server.port=8443"
- "traefik.http.services.laravel-web.loadbalancer.server.scheme=https"
# Health check
- "traefik.http.services.laravel-web.loadbalancer.healthcheck.path=/up"
- "traefik.http.services.laravel-web.loadbalancer.healthcheck.interval=30s"
- "traefik.http.services.laravel-web.loadbalancer.healthcheck.timeout=5s"
- "traefik.http.services.laravel-web.loadbalancer.healthcheck.scheme=https"
schedule:
image: ${SPIN_IMAGE_DOCKERFILE_PHP}
environment:
APP_ENV: "${SPIN_DEPLOYMENT_ENVIRONMENT}"
networks:
- web-public
volumes:
- "storage_private:/var/www/html/storage/app/private/"
- "storage_public:/var/www/html/storage/app/public/"
- "storage_sessions:/var/www/html/storage/framework/sessions"
- "storage_logs:/var/www/html/storage/logs"
- "database_sqlite:/var/www/html/.infrastructure/volume_data/sqlite"
deploy:
replicas: 1
update_config:
failure_action: rollback
parallelism: 1
delay: 5s
order: start-first
rollback_config:
parallelism: 0
order: stop-first
restart_policy:
condition: any
delay: 10s
max_attempts: 3
window: 120s
meilisearch:
volumes:
- meilisearch_data:/meili_data
networks:
- web-public
deploy:
replicas: 1
update_config:
parallelism: 1
delay: 5s
order: start-first
queue:
image: ${SPIN_IMAGE_DOCKERFILE_PHP}
environment:
APP_ENV: "${SPIN_DEPLOYMENT_ENVIRONMENT}"
networks:
- web-public
volumes:
- "storage_private:/var/www/html/storage/app/private/"
- "storage_public:/var/www/html/storage/app/public/"
- "storage_sessions:/var/www/html/storage/framework/sessions"
- "storage_logs:/var/www/html/storage/logs"
- "database_sqlite:/var/www/html/.infrastructure/volume_data/sqlite"
deploy:
replicas: 1
update_config:
failure_action: rollback
parallelism: 1
delay: 5s
order: start-first
rollback_config:
parallelism: 0
order: stop-first
restart_policy:
condition: any
delay: 10s
max_attempts: 3
window: 120s
configs:
traefik:
name: "traefik-${SPIN_MD5_HASH_TRAEFIK_YML}.yml"
file: ./.infrastructure/conf/traefik/prod/traefik.yml
volumes:
certificates:
storage_private:
storage_public:
storage_sessions:
storage_logs:
database_sqlite:
meilisearch_data:
networks:
web-public: