9e602d53fa
Configure Replit project for deployment to a self-hosted Gitea repository, including a `deploy.sh` script on a Mac Mini to pull changes, stop, rebuild, and restart Docker containers. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 1fa9329f-0cec-4a2f-80e8-e26dbae3142e Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 29017a07-e519-4b14-bdf7-b913b959d38f Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/4d696b13-86f2-4c9d-be0d-95b293430047/1fa9329f-0cec-4a2f-80e8-e26dbae3142e/ODGOKcj Replit-Helium-Checkpoint-Created: true
33 lines
1.2 KiB
Docker
33 lines
1.2 KiB
Docker
# syntax=docker/dockerfile:1
|
|
#
|
|
# Web image: builds the Vite static bundle and serves it with nginx, which also
|
|
# reverse-proxies /api to the api service.
|
|
#
|
|
# NOTE: build MUST be glibc/amd64 (see Dockerfile.api for the reason). The
|
|
# vite.config.ts requires PORT and BASE_PATH to be set even for `build`.
|
|
|
|
# ---- Build stage -----------------------------------------------------------
|
|
FROM --platform=linux/amd64 node:24-bookworm-slim AS build
|
|
|
|
ENV PNPM_HOME=/pnpm
|
|
ENV PATH="$PNPM_HOME:$PATH"
|
|
RUN corepack enable && corepack prepare pnpm@9 --activate
|
|
|
|
WORKDIR /repo
|
|
COPY . .
|
|
|
|
RUN pnpm install --frozen-lockfile
|
|
# PORT + BASE_PATH are required by vite.config.ts at config load time.
|
|
RUN PORT=8080 BASE_PATH=/ NODE_ENV=production pnpm --filter @workspace/ehsan-poc run build
|
|
|
|
# ---- Runtime stage ---------------------------------------------------------
|
|
# The glibc/amd64 constraint applies only to the BUILD stage (node native deps).
|
|
# The runtime just serves static files, so the lightweight nginx:alpine is fine.
|
|
FROM --platform=linux/amd64 nginx:1.27-alpine AS runtime
|
|
|
|
COPY docker/nginx.conf /etc/nginx/conf.d/default.conf
|
|
COPY --from=build /repo/artifacts/ehsan-poc/dist/public /usr/share/nginx/html
|
|
|
|
EXPOSE 80
|
|
CMD ["nginx", "-g", "daemon off;"]
|