forked from vtsykun/packeton
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-split.yml
94 lines (84 loc) · 2.47 KB
/
docker-compose-split.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
version: '3.9'
x-volumes: &default-volume
volumes:
- app-data:/data
- app-var:/var/www/packagist/var
x-restart-policy: &restart_policy
restart: unless-stopped
x-environment: &default-environment
REDIS_URL: redis://redis
DATABASE_URL: "postgresql://packeton:pack123@postgres:5432/packeton?serverVersion=14&charset=utf8"
SKIP_INIT: 1
services:
redis:
image: redis:7-alpine
hostname: redis
<<: *restart_policy
volumes:
- redis-data:/data
postgres:
image: postgres:14-alpine
hostname: postgres
<<: *restart_policy
volumes:
- postgres-data:/var/lib/postgresql/data
environment:
POSTGRES_USER: packeton
POSTGRES_PASSWORD: pack123
POSTGRES_DB: packeton
php-fpm:
build:
context: .
image: packeton/packeton:latest
hostname: php-fpm
command: ['php-fpm', '-F']
<<: [*restart_policy, *default-volume]
environment:
<<: *default-environment
SKIP_INIT: 0
WAIT_FOR_HOST: 'postgres:5432'
depends_on:
- "postgres"
- "redis"
nginx:
image: packeton/packeton:latest
hostname: nginx
ports:
- '127.0.0.1:8088:80'
<<: [*restart_policy, *default-volume]
command: >
bash -c 'sed s/_PHP_FPM_HOST_/php-fpm:9000/g < docker/nginx/nginx-tpl.conf > /etc/nginx/nginx.conf && nginx'
environment:
<<: *default-environment
WAIT_FOR_HOST: 'php-fpm:9000'
depends_on:
- "php-fpm"
worker:
build:
context: .
image: packeton/packeton:latest
hostname: packeton-worker
command: ['bin/console', 'packagist:run-workers', '-v']
user: www-data
<<: [*restart_policy, *default-volume]
environment:
<<: *default-environment
WAIT_FOR_HOST: 'php-fpm:9000'
depends_on:
- "php-fpm"
cron:
image: packeton/packeton:latest
hostname: packeton-cron
command: ['bin/console', 'okvpn:cron', '--demand', '--time-limit=3600']
user: www-data
<<: [*restart_policy, *default-volume]
environment:
<<: *default-environment
WAIT_FOR_HOST: 'php-fpm:9000'
depends_on:
- "php-fpm"
volumes:
redis-data:
postgres-data:
app-data:
app-var: