hub-site/Dockerfile
mrrpnya 3580d9e5d3
Some checks failed
Testing / test (push) Waiting to run
Testing / test (pull_request) Has been cancelled
Updated Dockerfile to be faster and more secure
2025-03-05 22:46:02 -08:00

21 lines
No EOL
490 B
Docker
Executable file

# build stage
FROM node:lts-alpine as build-stage
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci --omit=dev
COPY . .
RUN npm run build
# production stage
FROM nginx:stable-alpine as production-stage
# Remove default Nginx index page
RUN rm -rf /usr/share/nginx/html/*
# Copy built files from build stage
COPY --from=build-stage /app/dist /usr/share/nginx/html
EXPOSE 80
# Use a non-root user for security
USER nginx
CMD ["nginx", "-g", "daemon off;"]