TelegramPWA/Dockerfile
Tianrong Zhang 6968a7c337 Add Docker Compose deployment config
Multi-stage Dockerfile: node:22-alpine builder + nginx:alpine server.
nginx.conf sets COOP/COEP headers (required for SharedArrayBuffer/audio workers),
SPA fallback, and aggressive caching for content-hashed assets.
API credentials and BASE_URL passed as build args.
2026-06-11 22:29:33 -04:00

29 lines
440 B
Docker

FROM node:22-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
ARG TELEGRAM_API_ID
ARG TELEGRAM_API_HASH
ARG BASE_URL=/
ENV TELEGRAM_API_ID=$TELEGRAM_API_ID
ENV TELEGRAM_API_HASH=$TELEGRAM_API_HASH
ENV BASE_URL=$BASE_URL
ENV NODE_ENV=production
RUN npm run build:production
# ---
FROM nginx:alpine
COPY --from=builder /app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80