-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
48 lines (44 loc) · 1.41 KB
/
Copy pathdocker-compose.yml
File metadata and controls
48 lines (44 loc) · 1.41 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
services:
db:
image: postgres:18-alpine
restart: unless-stopped
environment:
POSTGRES_USER: subnetly
POSTGRES_PASSWORD: subnetly
POSTGRES_DB: subnetly
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U subnetly -d subnetly"]
interval: 5s
timeout: 5s
retries: 10
app:
build:
context: .
dockerfile: Dockerfile
restart: unless-stopped
ports:
# Change the host port (left side) if needed.
- "3000:3000"
extra_hosts:
- "host.docker.internal:host-gateway"
# For health checks to reach LAN services on Linux, uncomment the next line
# and remove the "ports" section above (host networking exposes port 3000 directly):
# network_mode: host
# Then also change DATABASE_URL below to use 127.0.0.1 instead of db:
# DATABASE_URL: "postgresql://subnetly:subnetly@127.0.0.1:5432/subnetly?schema=public"
environment:
DATABASE_URL: "postgresql://subnetly:subnetly@db:5432/subnetly?schema=public"
NODE_ENV: production
# REQUIRED: replace with a strong random secret.
BETTER_AUTH_SECRET: "replace-with-a-long-random-secret"
# Optional: allow self-signed certs for service health checks.
HEALTHCHECK_ALLOW_SELF_SIGNED: "false"
depends_on:
db:
condition: service_healthy
volumes:
pgdata: