feat: add Docker/OpenTofu deployment and DE/NL routing
This commit is contained in:
@@ -0,0 +1,100 @@
|
||||
name: watermaps-production
|
||||
|
||||
services:
|
||||
watermaps:
|
||||
image: ${WATERMAPS_APP_IMAGE:-watermaps:production}
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
environment:
|
||||
NODE_ENV: production
|
||||
HOST: 0.0.0.0
|
||||
PORT: 5174
|
||||
DATABASE_URL: ""
|
||||
REDIS_URL: ""
|
||||
WATERMAPS_WEB_DIST_PATH: /app/apps/web/dist
|
||||
WATERMAPS_LOCAL_FAIRWAYS_PATH: /data/germany-netherlands-fairways.json
|
||||
WATERMAPS_LIVE_FAIRWAYS: "false"
|
||||
WATERMAPS_DEMO_DATA: "false"
|
||||
expose:
|
||||
- "5174"
|
||||
volumes:
|
||||
- type: bind
|
||||
source: ${WATERMAPS_DATA_DIR:-/srv/watermaps-data}/local
|
||||
target: /data
|
||||
read_only: true
|
||||
restart: unless-stopped
|
||||
init: true
|
||||
security_opt:
|
||||
- no-new-privileges:true
|
||||
cap_drop:
|
||||
- ALL
|
||||
healthcheck:
|
||||
test:
|
||||
- CMD
|
||||
- node
|
||||
- -e
|
||||
- >-
|
||||
fetch('http://127.0.0.1:5174/health')
|
||||
.then(response => { if (!response.ok) process.exit(1) })
|
||||
.catch(() => process.exit(1))
|
||||
interval: 15s
|
||||
timeout: 5s
|
||||
start_period: 15s
|
||||
retries: 5
|
||||
|
||||
nginx:
|
||||
image: ${WATERMAPS_NGINX_IMAGE:-nginx:1.30.4-alpine}
|
||||
depends_on:
|
||||
watermaps:
|
||||
condition: service_healthy
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
volumes:
|
||||
- type: bind
|
||||
source: ${WATERMAPS_RUNTIME_DIR:-/srv/watermaps-runtime}/nginx/conf.d
|
||||
target: /etc/nginx/conf.d
|
||||
read_only: true
|
||||
- type: bind
|
||||
source: ${WATERMAPS_DATA_DIR:-/srv/watermaps-data}/certbot/www
|
||||
target: /var/www/certbot
|
||||
read_only: true
|
||||
- type: bind
|
||||
source: ${WATERMAPS_DATA_DIR:-/srv/watermaps-data}/certbot/letsencrypt
|
||||
target: /etc/letsencrypt
|
||||
read_only: true
|
||||
restart: unless-stopped
|
||||
security_opt:
|
||||
- no-new-privileges:true
|
||||
healthcheck:
|
||||
test: ["CMD", "nginx", "-t"]
|
||||
interval: 30s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
|
||||
certbot:
|
||||
image: ${WATERMAPS_CERTBOT_IMAGE:-certbot/certbot:v5.7.0}
|
||||
profiles: ["maintenance"]
|
||||
volumes:
|
||||
- type: bind
|
||||
source: ${WATERMAPS_DATA_DIR:-/srv/watermaps-data}/certbot/www
|
||||
target: /var/www/certbot
|
||||
- type: bind
|
||||
source: ${WATERMAPS_DATA_DIR:-/srv/watermaps-data}/certbot/letsencrypt
|
||||
target: /etc/letsencrypt
|
||||
|
||||
route-data:
|
||||
image: ${WATERMAPS_ROUTE_DATA_IMAGE:-watermaps-route-data:production}
|
||||
build:
|
||||
context: .
|
||||
dockerfile: deploy/route-data.Dockerfile
|
||||
profiles: ["maintenance"]
|
||||
environment:
|
||||
WATERMAPS_GEOFABRIK_DIR: /workspace/data/geofabrik
|
||||
WATERMAPS_LOCAL_FAIRWAYS_PATH: /workspace/data/local/germany-netherlands-fairways.json
|
||||
volumes:
|
||||
- type: bind
|
||||
source: ${WATERMAPS_DATA_DIR:-/srv/watermaps-data}
|
||||
target: /workspace/data
|
||||
restart: "no"
|
||||
Reference in New Issue
Block a user