Converted to a docker swarm friendly stack
This commit is contained in:
@@ -1,21 +1,13 @@
|
|||||||
# =============================================================================
|
# =============================================================================
|
||||||
# PatchMon Docker Compose - Production
|
# PatchMon Docker Swarm Stack - Production
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
# Before starting, copy env.example to .env and fill in your values:
|
# Deploy via Portainer as a stack, with your .env file contents pasted
|
||||||
#
|
# into the "Environment variables" section in Portainer.
|
||||||
# cp env.example .env
|
|
||||||
#
|
|
||||||
# Then start PatchMon:
|
|
||||||
#
|
|
||||||
# docker compose up -d
|
|
||||||
#
|
|
||||||
# See the PatchMon documentation for full configuration details.
|
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
|
|
||||||
services:
|
services:
|
||||||
database:
|
database:
|
||||||
image: postgres:17-alpine
|
image: postgres:17-alpine
|
||||||
restart: unless-stopped
|
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_DB: patchmon_db
|
POSTGRES_DB: patchmon_db
|
||||||
POSTGRES_USER: patchmon_user
|
POSTGRES_USER: patchmon_user
|
||||||
@@ -34,14 +26,18 @@ services:
|
|||||||
options:
|
options:
|
||||||
max-size: "10m"
|
max-size: "10m"
|
||||||
max-file: "3"
|
max-file: "3"
|
||||||
|
deploy:
|
||||||
|
replicas: 1
|
||||||
|
restart_policy:
|
||||||
|
condition: on-failure
|
||||||
|
delay: 5s
|
||||||
|
max_attempts: 3
|
||||||
|
placement:
|
||||||
|
constraints:
|
||||||
|
- node.hostname == Docker-Swarm-1
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
image: redis:7-alpine
|
image: redis:7-alpine
|
||||||
restart: unless-stopped
|
|
||||||
# Simple Redis configuration - no memory limits to prevent OOM errors
|
|
||||||
# If you need memory limits, set maxmemory-policy to 'allkeys-lru' instead of 'noeviction'
|
|
||||||
# to allow eviction rather than rejecting commands
|
|
||||||
# Debug logging: Use --loglevel debug for maximum verbosity, or --loglevel verbose for less output
|
|
||||||
command: redis-server --requirepass ${REDIS_PASSWORD}
|
command: redis-server --requirepass ${REDIS_PASSWORD}
|
||||||
volumes:
|
volumes:
|
||||||
- redis_data:/data
|
- redis_data:/data
|
||||||
@@ -57,13 +53,19 @@ services:
|
|||||||
options:
|
options:
|
||||||
max-size: "10m"
|
max-size: "10m"
|
||||||
max-file: "3"
|
max-file: "3"
|
||||||
|
deploy:
|
||||||
|
replicas: 1
|
||||||
|
restart_policy:
|
||||||
|
condition: on-failure
|
||||||
|
delay: 5s
|
||||||
|
max_attempts: 3
|
||||||
|
placement:
|
||||||
|
constraints:
|
||||||
|
- node.hostname == Docker-Swarm-1
|
||||||
|
|
||||||
backend:
|
backend:
|
||||||
image: ghcr.io/patchmon/patchmon-backend:latest
|
image: ghcr.io/patchmon/patchmon-backend:latest
|
||||||
restart: unless-stopped
|
|
||||||
env_file: .env
|
|
||||||
environment:
|
environment:
|
||||||
# Internal Docker wiring - do not change
|
|
||||||
DATABASE_URL: postgresql://patchmon_user:${POSTGRES_PASSWORD}@database:5432/patchmon_db
|
DATABASE_URL: postgresql://patchmon_user:${POSTGRES_PASSWORD}@database:5432/patchmon_db
|
||||||
REDIS_HOST: redis
|
REDIS_HOST: redis
|
||||||
REDIS_PORT: 6379
|
REDIS_PORT: 6379
|
||||||
@@ -75,31 +77,43 @@ services:
|
|||||||
- branding_assets:/app/assets
|
- branding_assets:/app/assets
|
||||||
networks:
|
networks:
|
||||||
- patchmon-internal
|
- patchmon-internal
|
||||||
depends_on:
|
|
||||||
- database
|
|
||||||
- redis
|
|
||||||
logging:
|
logging:
|
||||||
driver: "json-file"
|
driver: "json-file"
|
||||||
options:
|
options:
|
||||||
max-size: "10m"
|
max-size: "10m"
|
||||||
max-file: "3"
|
max-file: "3"
|
||||||
|
deploy:
|
||||||
|
replicas: 1
|
||||||
|
restart_policy:
|
||||||
|
condition: on-failure
|
||||||
|
delay: 5s
|
||||||
|
max_attempts: 3
|
||||||
|
placement:
|
||||||
|
constraints:
|
||||||
|
- node.hostname == Docker-Swarm-1
|
||||||
|
|
||||||
frontend:
|
frontend:
|
||||||
image: ghcr.io/patchmon/patchmon-frontend:latest
|
image: ghcr.io/patchmon/patchmon-frontend:latest
|
||||||
restart: unless-stopped
|
|
||||||
ports:
|
ports:
|
||||||
- "3030:3000"
|
- "3030:3000"
|
||||||
volumes:
|
volumes:
|
||||||
- branding_assets:/usr/share/nginx/html/assets
|
- branding_assets:/usr/share/nginx/html/assets
|
||||||
networks:
|
networks:
|
||||||
- patchmon-internal
|
- patchmon-internal
|
||||||
depends_on:
|
|
||||||
- backend
|
|
||||||
logging:
|
logging:
|
||||||
driver: "json-file"
|
driver: "json-file"
|
||||||
options:
|
options:
|
||||||
max-size: "10m"
|
max-size: "10m"
|
||||||
max-file: "3"
|
max-file: "3"
|
||||||
|
deploy:
|
||||||
|
replicas: 1
|
||||||
|
restart_policy:
|
||||||
|
condition: on-failure
|
||||||
|
delay: 5s
|
||||||
|
max_attempts: 3
|
||||||
|
placement:
|
||||||
|
constraints:
|
||||||
|
- node.hostname == Docker-Swarm-1
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
postgres_data:
|
postgres_data:
|
||||||
@@ -109,4 +123,4 @@ volumes:
|
|||||||
|
|
||||||
networks:
|
networks:
|
||||||
patchmon-internal:
|
patchmon-internal:
|
||||||
driver: bridge
|
driver: overlay
|
||||||
Reference in New Issue
Block a user