-
Notifications
You must be signed in to change notification settings - Fork 329
/
Copy pathdocker-compose.yml
108 lines (101 loc) · 2.58 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
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
---
services:
api: &api-environment
image: jhumanj/opnform-api:latest
container_name: opnform-api
build: &api-build
context: .
dockerfile: docker/Dockerfile.api
args:
APP_ENV: production
COMPOSER_FLAGS: --no-dev
volumes: &api-environment-volumes
- ./api/storage:/usr/share/nginx/html/storage:rw
environment: &api-env
APP_ENV: production
IS_API_WORKER: "false"
# Database settings
DB_HOST: db
REDIS_HOST: redis
DB_DATABASE: ${DB_DATABASE:-forge}
DB_USERNAME: ${DB_USERNAME:-forge}
DB_PASSWORD: ${DB_PASSWORD:-forge}
DB_CONNECTION: ${DB_CONNECTION:-pgsql}
# Storage settings
FILESYSTEM_DISK: local
LOCAL_FILESYSTEM_VISIBILITY: public
env_file:
- ./api/.env
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
api-worker:
<<: *api-environment
container_name: opnform-api-worker
build: *api-build
command: ["php", "artisan", "queue:work"]
volumes: *api-environment-volumes
environment:
<<: *api-env
APP_ENV: production
IS_API_WORKER: "true"
env_file:
- ./api/.env
api-scheduler:
<<: *api-environment
container_name: opnform-api-scheduler
build: *api-build
command: ["php", "artisan", "schedule:work"]
volumes: *api-environment-volumes
environment:
<<: *api-env
APP_ENV: production
IS_API_WORKER: "true"
# Scheduler settings
CONTAINER_ROLE: scheduler
PHP_MEMORY_LIMIT: 512M
PHP_MAX_EXECUTION_TIME: 60
env_file:
- ./api/.env
ui:
image: jhumanj/opnform-client:latest
container_name: opnform-client
build:
context: .
dockerfile: docker/Dockerfile.client
env_file:
- ./client/.env
redis:
image: redis:7
container_name: opnform-redis
db:
image: postgres:16
container_name: opnform-db
environment:
POSTGRES_DB: ${DB_DATABASE:-forge}
POSTGRES_USER: ${DB_USERNAME:-forge}
POSTGRES_PASSWORD: ${DB_PASSWORD:-forge}
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USERNAME:-forge}"]
interval: 5s
timeout: 5s
retries: 5
volumes:
- postgres-data:/var/lib/postgresql/data
ingress:
image: nginx:1
container_name: opnform-ingress
volumes:
- ./docker/nginx.conf:/etc/nginx/templates/default.conf.template
ports:
- 80:80
depends_on:
api:
condition: service_started
ui:
condition: service_started
volumes:
postgres-data:
opnform_storage: