79 lines
2.1 KiB
YAML
79 lines
2.1 KiB
YAML
services:
|
|
rnotes:
|
|
build:
|
|
context: ..
|
|
dockerfile: rnotes-online/Dockerfile
|
|
container_name: rnotes-online
|
|
restart: unless-stopped
|
|
environment:
|
|
- INFISICAL_CLIENT_ID=${INFISICAL_CLIENT_ID}
|
|
- INFISICAL_CLIENT_SECRET=${INFISICAL_CLIENT_SECRET}
|
|
- INFISICAL_PROJECT_SLUG=rnotes
|
|
- INFISICAL_ENV=prod
|
|
- INFISICAL_URL=http://infisical:8080
|
|
- DATABASE_URL=postgresql://rnotes:${DB_PASSWORD}@rnotes-postgres:5432/rnotes
|
|
volumes:
|
|
- uploads_data:/app/uploads
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.http.routers.rnotes.rule=Host(`rnotes.online`) || Host(`www.rnotes.online`)"
|
|
- "traefik.http.routers.rnotes.entrypoints=web"
|
|
- "traefik.http.routers.rnotes.priority=130"
|
|
- "traefik.http.services.rnotes.loadbalancer.server.port=3000"
|
|
# Wildcard subdomain routing (e.g. cca.rnotes.online)
|
|
- "traefik.http.routers.rnotes-wildcard.rule=HostRegexp(`{sub:[a-z0-9-]+}.rnotes.online`)"
|
|
- "traefik.http.routers.rnotes-wildcard.entrypoints=web"
|
|
- "traefik.http.routers.rnotes-wildcard.priority=100"
|
|
- "traefik.http.routers.rnotes-wildcard.service=rnotes"
|
|
networks:
|
|
- traefik-public
|
|
- rnotes-internal
|
|
depends_on:
|
|
rnotes-postgres:
|
|
condition: service_healthy
|
|
cap_drop:
|
|
- ALL
|
|
security_opt:
|
|
- no-new-privileges:true
|
|
read_only: true
|
|
tmpfs:
|
|
- /tmp
|
|
- /home/nextjs/.npm
|
|
|
|
rnotes-postgres:
|
|
image: postgres:16-alpine
|
|
container_name: rnotes-postgres
|
|
restart: unless-stopped
|
|
environment:
|
|
- POSTGRES_USER=rnotes
|
|
- POSTGRES_PASSWORD=${DB_PASSWORD}
|
|
- POSTGRES_DB=rnotes
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
networks:
|
|
- rnotes-internal
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U rnotes -d rnotes"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
cap_drop:
|
|
- ALL
|
|
cap_add:
|
|
- DAC_OVERRIDE
|
|
- FOWNER
|
|
- SETGID
|
|
- SETUID
|
|
security_opt:
|
|
- no-new-privileges:true
|
|
|
|
networks:
|
|
traefik-public:
|
|
external: true
|
|
rnotes-internal:
|
|
internal: true
|
|
|
|
volumes:
|
|
postgres_data:
|
|
uploads_data:
|