Files
storycove/docker-compose.yml
Stefan Hardegger 9f3bee826b Fix nginx configuration for Portainer deployment
- Remove quotes from Connection header value to fix nginx parsing error
- Simplify Cache-Control header to avoid argument parsing issues
- Clean up embedded nginx config formatting for better compatibility
- Resolves "invalid number of arguments in proxy_set_header directive" error

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-23 14:38:50 +02:00

129 lines
3.7 KiB
YAML

networks:
storycove-network:
driver: bridge
services:
nginx:
image: nginx:alpine
ports:
- "6925:80"
volumes:
- images_data:/app/images:ro
configs:
- source: nginx_config
target: /etc/nginx/nginx.conf
depends_on:
- frontend
- backend
networks:
- storycove-network
frontend:
build: ./frontend
environment:
- NEXT_PUBLIC_API_URL=http://backend:8080/api
depends_on:
- backend
networks:
- storycove-network
backend:
build: ./backend
environment:
- SPRING_DATASOURCE_URL=jdbc:postgresql://postgres:5432/storycove
- SPRING_DATASOURCE_USERNAME=storycove
- SPRING_DATASOURCE_PASSWORD=${DB_PASSWORD}
- JWT_SECRET=${JWT_SECRET}
- TYPESENSE_API_KEY=${TYPESENSE_API_KEY}
- TYPESENSE_HOST=typesense
- TYPESENSE_PORT=8108
- IMAGE_STORAGE_PATH=/app/images
- APP_PASSWORD=${APP_PASSWORD}
volumes:
- images_data:/app/images
depends_on:
- postgres
- typesense
networks:
- storycove-network
postgres:
image: postgres:15-alpine
# No port mapping - only accessible within the Docker network
environment:
- POSTGRES_DB=storycove
- POSTGRES_USER=storycove
- POSTGRES_PASSWORD=${DB_PASSWORD}
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- storycove-network
typesense:
image: typesense/typesense:0.25.0
# No port mapping - only accessible within the Docker network
environment:
- TYPESENSE_API_KEY=${TYPESENSE_API_KEY}
- TYPESENSE_DATA_DIR=/data
volumes:
- typesense_data:/data
networks:
- storycove-network
volumes:
postgres_data:
typesense_data:
images_data:
configs:
nginx_config:
content: |
events {
worker_connections 1024;
}
http {
upstream frontend {
server frontend:3000;
}
upstream backend {
server backend:8080;
}
server {
listen 80;
client_max_body_size 10M;
location / {
proxy_pass http://frontend;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection upgrade;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_cache_bypass $http_upgrade;
}
location /api/ {
proxy_pass http://backend/api/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_connect_timeout 60s;
proxy_send_timeout 60s;
proxy_read_timeout 60s;
}
location /images/ {
alias /app/images/;
expires 1y;
add_header Cache-Control public;
}
location /typesense/ {
proxy_pass http://typesense:8108/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Typesense-API-Key $http_x_typesense_api_key;
}
}
}