Files
gibbz/Dockerfile
T
mats b6cc9f3465
Build and Publish / Metadata (push) Successful in 1s
Build and Publish / BuildAndDeployAmd64 (push) Successful in 22s
feat(build): bundle frontend with vite and matrix-js-sdk, fix HOST in server.js
2026-09-22 10:29:03 +02:00

31 lines
550 B
Docker

ARG APP_RELEASE=dev
FROM node:22-alpine AS app
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY server.js tracing.js vite.config.mjs ./
COPY public/ ./public/
# Inject build release into index.html if APP_RELEASE is specified
ARG APP_RELEASE
ENV APP_RELEASE=${APP_RELEASE}
RUN if [ -n "${APP_RELEASE}" ]; then \
sed -i "s/window.__APP_RELEASE__ || \"dev\"/\"${APP_RELEASE}\"/g" ./public/index.html; \
fi
RUN npm run build && npm prune --omit=dev
ENV PORT=8080 \
HOST=0.0.0.0
EXPOSE 8080
USER node
CMD ["node", "server.js"]