Use additional_contexts to copy platform server package into the Docker build context. Rewrites the file: dependency path and removes the lockfile so npm install can resolve the local package correctly. Applied to both production and dev Dockerfiles.
46 lines
936 B
YAML
46 lines
936 B
YAML
version: '3.8'
|
|
|
|
services:
|
|
# Backend server (development with hot reload)
|
|
server:
|
|
build:
|
|
context: ./server
|
|
dockerfile: Dockerfile.dev
|
|
additional_contexts:
|
|
platform-server: ../cc-platform-core/server
|
|
container_name: turtle-server-dev
|
|
ports:
|
|
- "3001:3001"
|
|
- "3002:3002"
|
|
volumes:
|
|
- ./server:/app
|
|
- /app/node_modules
|
|
environment:
|
|
- NODE_ENV=development
|
|
command: npm run dev
|
|
networks:
|
|
- turtle-network
|
|
|
|
# Frontend client (development with hot reload)
|
|
client:
|
|
build:
|
|
context: ./client
|
|
dockerfile: Dockerfile.dev
|
|
container_name: turtle-client-dev
|
|
ports:
|
|
- "3000:3000"
|
|
volumes:
|
|
- ./client:/app
|
|
- /app/node_modules
|
|
environment:
|
|
- NODE_ENV=development
|
|
depends_on:
|
|
- server
|
|
command: npm run dev
|
|
networks:
|
|
- turtle-network
|
|
|
|
networks:
|
|
turtle-network:
|
|
driver: bridge
|