forked from bagofwords1/bagofwords
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
115 lines (110 loc) · 3.38 KB
/
docker-compose.yaml
File metadata and controls
115 lines (110 loc) · 3.38 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# =============================================================================
# Bag of Words - Production Docker Compose with Caddy (SSL/HTTPS)
# =============================================================================
#
# Quick Start:
# 1. Create a .env file with your configuration (see below)
# 2. Update Caddyfile with your domain
# 3. Run: docker compose up -d
#
# Environment Variables (create .env file):
# DOMAIN=yourdomain.com # Your domain name (required for SSL)
# POSTGRES_USER=bow # PostgreSQL username
# POSTGRES_PASSWORD=your_secure_pw # PostgreSQL password (CHANGE THIS!)
# POSTGRES_DB=bagofwords # Database name
# BOW_ENCRYPTION_KEY= # Fernet encryption key (44 chars, ends with =)
# BOW_LICENSE_KEY= # Enterprise license key (optional)
#
# Generate encryption key:
# python3 -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"
#
# For development without SSL, use: docker compose -f docker-compose.dev.yaml up -d
#
# =============================================================================
services:
postgres:
image: postgres:16-alpine
container_name: bow-postgres
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER:-bow}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-bowpassword}
POSTGRES_DB: ${POSTGRES_DB:-bagofwords}
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-bow} -d ${POSTGRES_DB:-bagofwords}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
networks:
- bow-network
app:
image: bagofwords/bagofwords:latest
pull_policy: always
container_name: bow-app
restart: unless-stopped
expose:
- "3000"
environment:
- NODE_ENV=production
- ENVIRONMENT=production
# Database configuration
- BOW_DATABASE_URL=postgresql://${POSTGRES_USER:-bow}:${POSTGRES_PASSWORD:-bowpassword}@postgres:5432/${POSTGRES_DB:-bagofwords}
# Encryption key
- BOW_ENCRYPTION_KEY=${BOW_ENCRYPTION_KEY:-}
# Enterprise license key (optional)
- BOW_LICENSE_KEY=${BOW_LICENSE_KEY:-}
# Config path
- BOW_CONFIG_PATH=/app/bow-config.yaml
volumes:
- ./bow-config.yaml:/app/bow-config.yaml:ro
- uploads_data:/app/backend/uploads
- branding_data:/app/backend/branding_uploads
- logs_data:/app/backend/logs
depends_on:
postgres:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-fsS", "http://localhost:3000/"]
interval: 30s
timeout: 5s
retries: 3
start_period: 60s
networks:
- bow-network
caddy:
image: caddy:2.10-alpine
container_name: bow-caddy
restart: unless-stopped
ports:
- "80:80"
- "443:443"
- "443:443/udp" # HTTP/3
environment:
- DOMAIN=${DOMAIN:-localhost}
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile:ro
- caddy_data:/data
- caddy_config:/config
depends_on:
- app
networks:
- bow-network
volumes:
postgres_data:
driver: local
uploads_data:
driver: local
branding_data:
driver: local
logs_data:
driver: local
caddy_data:
driver: local
caddy_config:
driver: local
networks:
bow-network:
driver: bridge