2022-07-01 23:06:50 +03:00
|
|
|
version: "3.7"
|
|
|
|
|
|
|
|
services:
|
2022-07-03 12:02:21 +03:00
|
|
|
# Reverse proxy
|
|
|
|
traefik:
|
|
|
|
image: "traefik:v2.8"
|
|
|
|
command:
|
|
|
|
#- "--log.level=DEBUG"
|
|
|
|
- "--api.insecure=true" # allows accessing a Traefik dashboard, disable in production
|
|
|
|
- "--providers.docker=true" # enables the Docker configuration discovery
|
|
|
|
- "--providers.docker.exposedbydefault=false" # do not expose Docker services by default
|
|
|
|
- "--entrypoints.web.address=:5000" # create an entrypoint called web, listening on :5000
|
|
|
|
ports:
|
|
|
|
- "5000:5000"
|
|
|
|
- "8765:8080"
|
|
|
|
volumes:
|
|
|
|
- "/var/run/docker.sock:/var/run/docker.sock:ro"
|
|
|
|
|
2022-07-03 11:27:11 +03:00
|
|
|
# Prisma sqlite migration utility
|
2022-07-01 23:06:50 +03:00
|
|
|
migrate:
|
|
|
|
build:
|
|
|
|
context: ./server/prisma
|
|
|
|
dockerfile: Dockerfile
|
|
|
|
volumes:
|
|
|
|
- sqlite:/database/
|
|
|
|
environment:
|
|
|
|
- DATABASE_URL=file:/database/db.sqlite
|
|
|
|
|
2022-07-03 11:27:11 +03:00
|
|
|
# Backend server for managing saved notes
|
2022-07-03 11:27:29 +03:00
|
|
|
backend:
|
2022-07-01 23:06:50 +03:00
|
|
|
build:
|
|
|
|
context: ./server
|
|
|
|
dockerfile: Dockerfile
|
|
|
|
volumes:
|
|
|
|
- sqlite:/database/
|
|
|
|
environment:
|
|
|
|
- DATABASE_URL=file:/database/db.sqlite
|
2022-07-03 12:02:21 +03:00
|
|
|
- FRONTEND_URL=http://localhost:5000
|
2022-07-02 22:14:07 +03:00
|
|
|
- CLEANUP_INTERVAL_SECONDS=600
|
|
|
|
- POST_LIMIT_WINDOW_SECONDS=86400
|
|
|
|
- POST_LIMIT=50
|
2022-07-06 16:07:51 +03:00
|
|
|
- NODE_ENV=production
|
2022-07-01 23:06:50 +03:00
|
|
|
depends_on:
|
2022-07-03 11:27:11 +03:00
|
|
|
migrate:
|
|
|
|
condition: service_completed_successfully
|
2022-07-03 12:02:21 +03:00
|
|
|
labels:
|
|
|
|
- "traefik.enable=true" # tell Traefik this is something we would like to expose
|
|
|
|
- "traefik.http.routers.backend.entrypoints=web" # what entrypoint should be used for the backend service.
|
|
|
|
- "traefik.http.routers.backend.rule=Host(`localhost`) && PathPrefix(`/api`) && Method(`POST`)" #
|
|
|
|
|
2022-07-03 11:27:11 +03:00
|
|
|
# Frontend for serving encrypted notes over HTML (SvelteKit)
|
2022-07-03 11:27:29 +03:00
|
|
|
frontend:
|
2022-07-03 11:27:11 +03:00
|
|
|
build:
|
|
|
|
context: ./webapp
|
|
|
|
dockerfile: Dockerfile
|
|
|
|
args:
|
2022-07-03 12:02:21 +03:00
|
|
|
- VITE_SERVER_INTERNAL=http://backend:8080
|
2022-07-03 11:27:11 +03:00
|
|
|
- VITE_BRANDING=Noteshare.space [preview]
|
|
|
|
depends_on:
|
2022-07-03 11:27:53 +03:00
|
|
|
- backend
|
2022-07-03 12:02:21 +03:00
|
|
|
labels:
|
|
|
|
- "traefik.enable=true" # tell Traefik this is something we would like to expose
|
|
|
|
- "traefik.http.routers.frontend.entrypoints=web" # what entrypoint should be used for the frontend service.
|
|
|
|
- "traefik.http.routers.frontend.rule=Host(`localhost`)" #
|
2022-07-01 23:06:50 +03:00
|
|
|
|
|
|
|
volumes:
|
|
|
|
sqlite:
|