The additional_contexts approach required cc-platform-core to exist on the Docker host at a relative path. This fails on servers where the repo layout differs. Instead, use a multi-stage build: stage 1 clones cc-platform-core from Gitea (depth 1), stage 2 copies server/ into the app and rewrites the file: path. Fully self-contained — no host deps. Applied to both production and dev Dockerfiles.
44 lines
857 B
YAML
44 lines
857 B
YAML
version: '3.8'
|
|
|
|
services:
|
|
# Backend server (development with hot reload)
|
|
server:
|
|
build:
|
|
context: ./server
|
|
dockerfile: Dockerfile.dev
|
|
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
|