mirror of
https://github.com/rgrgogu/new_starr.git
synced 2026-09-27 00:12:54 +08:00
fix(docker-compose): rebase build contexts and env/volume paths onto apps/api and apps/web (cont'd)
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,6 @@
|
|||||||
|
**/node_modules
|
||||||
|
.git
|
||||||
|
.env
|
||||||
|
*.log
|
||||||
|
docker-compose.yml
|
||||||
|
.dockerignore
|
||||||
+9
-3
@@ -14,11 +14,17 @@ COPY --from=typst /usr/bin/typst /usr/local/bin/typst
|
|||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Install production dependencies only
|
# Workspace manifests first (cache-friendly), then a filtered install —
|
||||||
|
# pnpm needs every workspace package's manifest present to resolve the
|
||||||
|
# graph even though only apps/api's deps get installed here.
|
||||||
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
|
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
|
||||||
RUN pnpm install --frozen-lockfile
|
COPY apps/api/package.json ./apps/api/package.json
|
||||||
|
COPY apps/web/package.json ./apps/web/package.json
|
||||||
|
RUN pnpm install --frozen-lockfile --filter api...
|
||||||
|
|
||||||
COPY . .
|
COPY apps/api ./apps/api
|
||||||
|
|
||||||
|
WORKDIR /app/apps/api
|
||||||
|
|
||||||
RUN chmod +x docker-entrypoint.sh
|
RUN chmod +x docker-entrypoint.sh
|
||||||
|
|
||||||
|
|||||||
+12
-10
@@ -2,9 +2,9 @@
|
|||||||
# $APP_NAME — Docker Compose (self-hosted)
|
# $APP_NAME — Docker Compose (self-hosted)
|
||||||
#
|
#
|
||||||
# Prerequisites:
|
# Prerequisites:
|
||||||
# 1. Backend → cp .env-production .env and fill in all CHANGE_ME values
|
# 1. Backend → cp apps/api/.env-production apps/api/.env and fill in all CHANGE_ME values
|
||||||
# 2. Frontend → cd ../new_starr_app && cp .env.example .env → fill in values
|
# 2. Frontend → cd apps/web && cp .env.example .env → fill in values
|
||||||
# → npm run build (must run BEFORE building the Docker image)
|
# → pnpm --filter web build (must run BEFORE building the Docker image)
|
||||||
# 3. Run: docker compose up -d
|
# 3. Run: docker compose up -d
|
||||||
#
|
#
|
||||||
# ⚠ SSL NOTE — db.config.js and the session store both require SSL from
|
# ⚠ SSL NOTE — db.config.js and the session store both require SSL from
|
||||||
@@ -30,10 +30,12 @@ services:
|
|||||||
|
|
||||||
# ── Backend (Express) ───────────────────────────────────────────────────────
|
# ── Backend (Express) ───────────────────────────────────────────────────────
|
||||||
backend:
|
backend:
|
||||||
build: .
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: apps/api/Dockerfile
|
||||||
ports:
|
ports:
|
||||||
- "3024:3024"
|
- "3024:3024"
|
||||||
env_file: .env
|
env_file: apps/api/.env
|
||||||
depends_on:
|
depends_on:
|
||||||
postgres:
|
postgres:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
@@ -44,9 +46,9 @@ services:
|
|||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
# ── Frontend (React / Nginx) ─────────────────────────────────────────────────
|
# ── Frontend (React / Nginx) ─────────────────────────────────────────────────
|
||||||
# Run `npm run build` inside ../new_starr_app before starting this service.
|
# Run `pnpm --filter web build` before starting this service.
|
||||||
frontend:
|
frontend:
|
||||||
build: ../new_starr_app
|
build: ./apps/web
|
||||||
ports:
|
ports:
|
||||||
- "80:80"
|
- "80:80"
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
@@ -86,13 +88,13 @@ services:
|
|||||||
image: dxflrs/garage
|
image: dxflrs/garage
|
||||||
entrypoint: ["/bin/sh", "/garage-init.sh"]
|
entrypoint: ["/bin/sh", "/garage-init.sh"]
|
||||||
volumes:
|
volumes:
|
||||||
- ./config/garage.toml:/etc/garage.toml:ro
|
- ./apps/api/config/garage.toml:/etc/garage.toml:ro
|
||||||
- ./scripts/garage-init.sh:/garage-init.sh:ro
|
- ./apps/api/scripts/garage-init.sh:/garage-init.sh:ro
|
||||||
- garage_meta:/var/lib/garage/meta
|
- garage_meta:/var/lib/garage/meta
|
||||||
- garage_data:/var/lib/garage/data
|
- garage_data:/var/lib/garage/data
|
||||||
ports:
|
ports:
|
||||||
- "3900:3900"
|
- "3900:3900"
|
||||||
env_file: .env
|
env_file: apps/api/.env
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD-SHELL", "test -f /var/lib/garage/meta/.ready && garage status > /dev/null 2>&1"]
|
test: ["CMD-SHELL", "test -f /var/lib/garage/meta/.ready && garage status > /dev/null 2>&1"]
|
||||||
interval: 10s
|
interval: 10s
|
||||||
|
|||||||
Reference in New Issue
Block a user