Refactor Docker setup and enhance development environment
- Updated docker-compose.dev.yml to use Dockerfile.dev for backend builds and added HOST environment variable for frontend. - Introduced Dockerfile.dev for streamlined backend development with Go. - Enhanced development documentation to reflect changes in local setup and API proxying. - Removed outdated frontend Dockerfile and adjusted frontend configuration for improved development experience.
This commit is contained in:
@@ -1,30 +1,31 @@
|
||||
# Development: backend (Go) on 8080, frontend (Nuxt dev) on 3000 with proxy to backend.
|
||||
# Open http://localhost:3000/map/ — /map/api, /map/updates, /map/grids are proxied to backend.
|
||||
|
||||
services:
|
||||
backend:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
ports:
|
||||
- "3080:3080"
|
||||
volumes:
|
||||
- ./grids:/map
|
||||
environment:
|
||||
- HNHMAP_PORT=3080
|
||||
- HNHMAP_BOOTSTRAP_PASSWORD=admin
|
||||
|
||||
frontend:
|
||||
image: node:20-alpine
|
||||
working_dir: /app
|
||||
command: sh -c "npm ci && npm run dev"
|
||||
ports:
|
||||
- "3000:3000"
|
||||
volumes:
|
||||
- ./frontend-nuxt:/app
|
||||
# Prevent overwriting node_modules from host
|
||||
- /app/node_modules
|
||||
environment:
|
||||
- NUXT_PUBLIC_API_BASE=/map/api
|
||||
depends_on:
|
||||
- backend
|
||||
# Development: backend API on 3080 + frontend Nuxt dev server on 3000.
|
||||
# Open http://localhost:3000/ for app development with live-reload.
|
||||
|
||||
services:
|
||||
backend:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile.dev
|
||||
ports:
|
||||
- "3080:3080"
|
||||
volumes:
|
||||
- ./grids:/map
|
||||
environment:
|
||||
- HNHMAP_PORT=3080
|
||||
- HNHMAP_BOOTSTRAP_PASSWORD=admin
|
||||
|
||||
frontend:
|
||||
image: node:20-alpine
|
||||
working_dir: /app
|
||||
command: sh -c "npm ci && npm run dev"
|
||||
ports:
|
||||
- "3000:3000"
|
||||
volumes:
|
||||
- ./frontend-nuxt:/app
|
||||
# Prevent overwriting node_modules from host
|
||||
- /app/node_modules
|
||||
environment:
|
||||
- NUXT_PUBLIC_API_BASE=/map/api
|
||||
- HOST=0.0.0.0
|
||||
depends_on:
|
||||
- backend
|
||||
|
||||
Reference in New Issue
Block a user