Files
krowworkforce_controltower/Dockerfile
Aravind 9a7852c8a2 Revert the self-hosted deploy fix
Restores the tree to 3b16d50, reverting:

  3c649fc  Fix blank page on self-hosted deploys

The earlier public-route commits were already reverted by 0ddbd35 and a51ab4a,
so this returns the working tree exactly to the state at 3b16d50.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-17 21:01:49 +05:30

33 lines
954 B
Docker

# ---- Build stage ----
FROM node:22-alpine AS build
WORKDIR /app
# Safety valve for the 2 GB host: without a cap a runaway build can exhaust the
# server's RAM and take down neighbouring containers. Measured peak for this app
# is ~550 MB, so 1 GB leaves headroom while still failing the build rather than
# the server. Raise this only if the host gets more RAM.
ENV NODE_OPTIONS=--max-old-space-size=1024
# Install deps from the lockfile first so this layer is reused when only src changes
COPY package.json package-lock.json ./
RUN npm ci --no-audit --no-fund
COPY . .
RUN npm run build
# ---- Runtime stage ----
FROM nginx:alpine
# Remove Nginx's default "Welcome" page files completely
RUN rm -rf /usr/share/nginx/html/*
# Only the compiled assets reach the final image — no node_modules, no source
COPY --from=build /app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/nginx.conf
EXPOSE 80 3000
CMD ["nginx", "-g", "daemon off;"]