refactor: clone repo from Gitea in Dockerfile instead of COPY
Replace local COPY with git clone --depth 1 so the image can be built without a local source context. Adds BRANCH build arg (default: main).
This commit is contained in:
@@ -540,11 +540,13 @@ docker compose up -d # Start Radicale CalDAV server
|
||||
|
||||
### Server Docker Image
|
||||
```bash
|
||||
# Build from repo root:
|
||||
# Build (clones from Gitea, no local context needed):
|
||||
docker build -f apps/server/docker/Dockerfile -t calchat-server .
|
||||
# Build from a specific branch:
|
||||
docker build -f apps/server/docker/Dockerfile --build-arg BRANCH=feature-x -t calchat-server .
|
||||
docker run -p 3000:3000 --env-file apps/server/.env calchat-server
|
||||
```
|
||||
Multi-stage build: compiles shared + server in build stage, copies only `dist/` and production dependencies to runtime stage. `.dockerignore` excludes `node_modules`, `dist`, `apps/client`, `.git`, `.env`, `*.md`.
|
||||
Multi-stage build: clones the repo from Gitea (`git clone --depth 1`) in the build stage using a `BRANCH` build arg (default: `main`), compiles shared + server, then copies only `dist/` and production dependencies to the runtime stage. No local source context required — the image can be built on any machine with Docker.
|
||||
|
||||
### Environment Variables
|
||||
Server requires `.env` file in `apps/server/`:
|
||||
|
||||
Reference in New Issue
Block a user