mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-09 01:16:15 -08:00
* docs(docker): restore self-hosted PWA compose flow * fix(docker): supervise self-hosted runtime processes * fix(docker): exit cleanly on container stop
41 lines
981 B
Docker
41 lines
981 B
Docker
FROM node:22-alpine AS build
|
|
|
|
RUN apk add --no-cache python3 make g++ git
|
|
|
|
WORKDIR /usr/src/app
|
|
|
|
COPY .npmrc ./
|
|
COPY package.json pnpm-lock.yaml ./
|
|
COPY patches ./patches
|
|
|
|
RUN corepack enable && pnpm install --frozen-lockfile --ignore-scripts
|
|
|
|
COPY . .
|
|
|
|
RUN pnpm nx build web --configuration=pwa
|
|
RUN pnpm nx build web-backend
|
|
|
|
FROM node:22-alpine
|
|
|
|
RUN apk add --no-cache gettext nginx
|
|
|
|
WORKDIR /opt/iptvnator
|
|
|
|
ENV PORT=3000
|
|
ENV BACKEND_URL=/api
|
|
ENV CLIENT_URL=http://localhost:4333
|
|
|
|
COPY --from=build /usr/src/app/dist/apps/web /usr/share/nginx/html
|
|
COPY --from=build /usr/src/app/dist/apps/web-backend ./web-backend
|
|
COPY docker/nginx.conf /etc/nginx/http.d/default.conf.template
|
|
COPY docker/docker-entrypoint.sh /usr/local/bin/iptvnator-entrypoint
|
|
|
|
RUN chmod +x /usr/local/bin/iptvnator-entrypoint
|
|
|
|
EXPOSE 80
|
|
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
|
|
CMD wget -qO- http://127.0.0.1/api/health >/dev/null || exit 1
|
|
|
|
CMD ["iptvnator-entrypoint"]
|