23 lines
612 B
Docker
23 lines
612 B
Docker
# ---- build ----
|
|
FROM node:20-alpine AS build
|
|
WORKDIR /app
|
|
COPY package*.json ./
|
|
RUN npm ci --no-audit --no-fund
|
|
COPY . .
|
|
|
|
# NEW: base path for Vite (e.g. /watch-party/)
|
|
ARG PUBLIC_BASE_PATH=/
|
|
ENV PUBLIC_BASE_PATH=${PUBLIC_BASE_PATH}
|
|
|
|
RUN npm run build
|
|
|
|
# ---- runtime (nginx) ----
|
|
FROM nginx:1.27-alpine
|
|
RUN apk add --no-cache gettext
|
|
COPY --from=build /app/dist /usr/share/nginx/html
|
|
COPY ops/nginx.conf.template /etc/nginx/conf.d/default.conf.template
|
|
COPY ops/entrypoint.sh /entrypoint.sh
|
|
RUN chmod +x /entrypoint.sh
|
|
ENV BACKEND_ORIGIN=http://localhost:8082
|
|
EXPOSE 80
|
|
ENTRYPOINT ["/bin/sh","/entrypoint.sh"] |