wxcc-monitor/docker-compose.dev.yml
jmcqueen 935c27854b Initial commit with Docker deployment support.
Containerize the monitor with production and dev compose stacks, fix healthchecks and port handling, and make the dashboard base path configurable for direct or proxied access.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-23 08:04:02 -04:00

73 lines
2.4 KiB
YAML

# =============================================================================
# wxcc-monitor - Development Docker Compose (Containerized Dev Testing)
#
# Purpose:
# Allows you to run the app inside Docker with live source editing + nodemon
# when you want to test the containerized environment without rebuilding.
#
# Primary daily development should still be done natively:
# npm run dev
#
# This file is designed to be run at the same time as docker-compose.yml
# (use different project names or just reference the file directly).
#
# Usage example:
# docker compose -f docker-compose.dev.yml --env-file .env up
# =============================================================================
services:
app-dev:
build:
context: .
dockerfile: Dockerfile
target: dev
container_name: wxcc-monitor-dev
restart: "no" # Dev containers usually don't need aggressive restart
# Use the same .env as native dev (or .env.dev if you prefer separation)
env_file:
- .env
environment:
PORT: "3000"
# Use a different host port so it doesn't conflict with native dev on 3000
ports:
- "3001:3000"
# Option A dev workflow: full source mount + nodemon inside the container
command: npm run dev
volumes:
# Full project source for live editing
- .:/app
# Prevent the host's node_modules from overwriting the container's
# (critical on macOS/Windows where host and container node_modules differ)
- /app/node_modules
# Still persist data and logs via bind mounts (as per requirements)
- ./data:/app/data
- ./logs:/app/logs
# No healthcheck or restart policy needed for short dev sessions
# (keeps output clean)
user: "1000:1000"
# More verbose logging during development
logging:
driver: "json-file"
options:
max-size: "5m"
max-file: "2"
# =============================================================================
# Notes
#
# - This is intended for occasional containerized testing only.
# - Your normal development workflow remains: run `npm run dev` directly on the host.
# - The /test prefix behavior is still controlled by your external reverse proxy.
# - You can run this stack at the same time as the production stack because
# it uses a different service name and (optionally) a different host port.
# =============================================================================