fix: Simplify docker-compose and fix build context

This commit is contained in:
Khoa Vo 2026-04-27 18:39:38 +07:00
parent d8be8109d1
commit aca6c578f4
2 changed files with 7 additions and 80 deletions

View file

@ -1,23 +0,0 @@
# Dependencies
node_modules
# Git
.git
.github
# IDE
.idea
.vscode
# OS
.DS_Store
# Environment
.env
.env.*
# Documentation
*.md
# Docker (but keep our Dockerfile)
docker-compose*.yml

View file

@ -2,77 +2,27 @@ services:
# Production frontend -- always runs
monochrome:
build:
context: ..
context: ../../
dockerfile: docker/Dockerfile
args:
- AUTH_ENABLED=${AUTH_ENABLED}
- AUTH_SECRET=${AUTH_SECRET}
- APPWRITE_ENDPOINT=${APPWRITE_ENDPOINT}
- APPWRITE_PROJECT_ID=${APPWRITE_PROJECT_ID}
- POCKETBASE_URL=${POCKETBASE_URL}
- SESSION_MAX_AGE=${SESSION_MAX_AGE}
container_name: monochrome
ports:
- '${MONOCHROME_PORT:-3000}:4173'
restart: unless-stopped
networks:
- monochrome-network
healthcheck:
test: ['CMD', 'wget', '--no-verbose', '--tries=1', '--spider', 'http://localhost:4173/']
interval: 30s
timeout: 3s
retries: 3
start_period: 5s
# PocketBase backend -- only starts with: docker compose --profile pocketbase up -d
pocketbase:
image: ghcr.io/muchobien/pocketbase:latest
container_name: monochrome-pocketbase
profiles:
- pocketbase
# CORS Proxy for audio streaming
cors-proxy:
image: nginx:alpine
container_name: cors-proxy
restart: unless-stopped
environment:
PB_ADMIN_EMAIL: ${PB_ADMIN_EMAIL:-admin@example.com}
PB_ADMIN_PASSWORD: ${PB_ADMIN_PASSWORD:-changeme}
TZ: ${TZ:-UTC}
ports:
- '${POCKETBASE_PORT:-8090}:8090'
- '8081:80'
volumes:
- pb_data:/pb_data
- pb_public:/pb_public
- pb_hooks:/pb_hooks
command: serve --http=0.0.0.0:8090
healthcheck:
test: ['CMD', 'wget', '--no-verbose', '--tries=1', '--spider', 'http://localhost:8090/api/health']
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
networks:
- monochrome-network
# Development server -- only starts with: docker compose --profile dev up -d
monochrome-dev:
build:
context: ..
dockerfile: docker/Dockerfile.dev
container_name: monochrome-dev
profiles:
- dev
ports:
- '${MONOCHROME_DEV_PORT:-5173}:5173'
volumes:
- ..:/app
- /app/node_modules
command: npm run dev -- --host 0.0.0.0
- ./cors-proxy.conf:/etc/nginx/nginx.conf:ro
networks:
- monochrome-network
networks:
monochrome-network:
driver: bridge
volumes:
pb_data:
pb_public:
pb_hooks: