Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
140 lines (132 loc) · 5.15 KB
/
Copy pathdocker-compose.yml
File metadata and controls
140 lines (132 loc) · 5.15 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
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
# Base services shared by every environment. No service publishes a host port
# here: docker-compose.override.yml (loaded automatically) publishes the local
# development ports, and docker-compose.prod.yml binds only the app to loopback
# for a reverse proxy.
name: taskora
services:
# The one PostgreSQL instance for Taskora. `restart: always` brings it back
# whenever Docker Desktop starts, so there is never a second copy to manage.
postgres:
image: postgres:18-alpine
container_name: taskora-postgres
restart: always
environment:
POSTGRES_USER: ${POSTGRES_USER:-taskora}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-local-dev-password}
POSTGRES_DB: ${POSTGRES_DB:-taskora}
volumes:
- taskora-postgres-data:/var/lib/postgresql
healthcheck:
test:
[
"CMD-SHELL",
"pg_isready -U ${POSTGRES_USER:-taskora} -d ${POSTGRES_DB:-taskora}",
]
interval: 5s
timeout: 5s
retries: 12
minio:
build:
context: .
dockerfile: docker/minio.Dockerfile
target: server
container_name: taskora-minio
restart: always
command: ["server", "--console-address", ":9001", "/data"]
environment:
MINIO_ROOT_USER: ${MINIO_ROOT_USER:-taskora}
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD:-local-minio-password}
MINIO_API_CORS_ALLOW_ORIGIN: ${S3_BROWSER_ORIGIN:-http://localhost:3000}
volumes:
- taskora-minio-data:/data
minio-init:
build:
context: .
dockerfile: docker/minio.Dockerfile
target: client
depends_on:
minio:
condition: service_started
entrypoint:
- /bin/sh
- -c
- >-
for attempt in $$(seq 1 30); do if mc alias set local http://minio:9000 "$${MINIO_ROOT_USER}" "$${MINIO_ROOT_PASSWORD}" && mc ready local; then mc mb --ignore-existing "local/$${S3_BUCKET}"; exit $$?; fi; sleep 2; done; exit 1
environment:
MINIO_ROOT_USER: ${MINIO_ROOT_USER:-taskora}
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD:-local-minio-password}
S3_BUCKET: ${S3_BUCKET:-taskora-private}
restart: "no"
app:
build:
context: .
target: runner
secrets:
- next_server_actions_encryption_key
restart: unless-stopped
environment:
NODE_ENV: production
DATABASE_URL: ${DATABASE_URL_DOCKER:-postgresql://taskora:local-dev-password@postgres:5432/taskora?sslmode=disable}
BETTER_AUTH_SECRET: ${BETTER_AUTH_SECRET:?Set BETTER_AUTH_SECRET in .env}
BETTER_AUTH_URL: ${BETTER_AUTH_URL:-http://localhost:3000}
BETTER_AUTH_TRUSTED_ORIGINS: ${BETTER_AUTH_TRUSTED_ORIGINS:-http://localhost:3000}
SCHEDULER_TOKEN: ${SCHEDULER_TOKEN:?Set SCHEDULER_TOKEN in .env}
DATABASE_POOL_MAX: ${DATABASE_POOL_MAX:-10}
S3_ENDPOINT: ${S3_ENDPOINT_DOCKER:-http://minio:9000}
S3_PUBLIC_ENDPOINT: ${S3_PUBLIC_ENDPOINT:-http://localhost:9000}
S3_REGION: ${S3_REGION:-us-east-1}
S3_BUCKET: ${S3_BUCKET:-taskora-private}
S3_ACCESS_KEY_ID: ${S3_ACCESS_KEY_ID:-taskora}
S3_SECRET_ACCESS_KEY: ${S3_SECRET_ACCESS_KEY:-local-minio-password}
VAPID_PUBLIC_KEY: ${VAPID_PUBLIC_KEY:-}
VAPID_PRIVATE_KEY: ${VAPID_PRIVATE_KEY:-}
VAPID_SUBJECT: ${VAPID_SUBJECT:-mailto:admin@example.test}
WEB_PUSH_ALLOWED_HOSTS: ${WEB_PUSH_ALLOWED_HOSTS:-fcm.googleapis.com,push.services.mozilla.com,web.push.apple.com}
NEXT_SERVER_ACTIONS_ENCRYPTION_KEY: ${NEXT_SERVER_ACTIONS_ENCRYPTION_KEY:?Set NEXT_SERVER_ACTIONS_ENCRYPTION_KEY in .env}
depends_on:
postgres:
condition: service_healthy
minio-init:
condition: service_completed_successfully
worker:
build:
context: .
target: worker
restart: unless-stopped
environment:
NODE_ENV: production
DATABASE_URL: ${DATABASE_URL_DOCKER:-postgresql://taskora:local-dev-password@postgres:5432/taskora?sslmode=disable}
BETTER_AUTH_SECRET: ${BETTER_AUTH_SECRET:?Set BETTER_AUTH_SECRET in .env}
DATABASE_POOL_MAX: ${DATABASE_POOL_MAX:-10}
S3_ENDPOINT: ${S3_ENDPOINT_DOCKER:-http://minio:9000}
S3_REGION: ${S3_REGION:-us-east-1}
S3_BUCKET: ${S3_BUCKET:-taskora-private}
S3_ACCESS_KEY_ID: ${S3_ACCESS_KEY_ID:-taskora}
S3_SECRET_ACCESS_KEY: ${S3_SECRET_ACCESS_KEY:-local-minio-password}
VAPID_PUBLIC_KEY: ${VAPID_PUBLIC_KEY:-}
VAPID_PRIVATE_KEY: ${VAPID_PRIVATE_KEY:-}
VAPID_SUBJECT: ${VAPID_SUBJECT:-mailto:admin@example.test}
WEB_PUSH_ALLOWED_HOSTS: ${WEB_PUSH_ALLOWED_HOSTS:-fcm.googleapis.com,push.services.mozilla.com,web.push.apple.com}
depends_on:
postgres:
condition: service_healthy
minio-init:
condition: service_completed_successfully
migrate:
build:
context: .
target: worker
profiles: ["setup"]
command: ["bun", "run", "db:migrate"]
environment:
NODE_ENV: production
DATABASE_URL: ${DATABASE_URL_DOCKER:-postgresql://taskora:local-dev-password@postgres:5432/taskora?sslmode=disable}
depends_on:
postgres:
condition: service_healthy
secrets:
next_server_actions_encryption_key:
environment: NEXT_SERVER_ACTIONS_ENCRYPTION_KEY
volumes:
taskora-postgres-data:
taskora-minio-data: