This commit is contained in:
Tomas Dvorak
2026-01-26 08:13:18 +01:00
parent aa036b6550
commit dfc079288f
505 changed files with 95755 additions and 5712 deletions
+45
View File
@@ -0,0 +1,45 @@
# Build stage
FROM node:18-alpine AS build
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install dependencies
RUN npm i -g npm@10 \
&& npm ci --prefer-offline --no-audit --no-fund || npm install --no-audit --no-fund
# Copy source
COPY . .
# Build app
ENV NODE_ENV=production
ENV GENERATE_SOURCEMAP=false
ENV CI=true
ENV TSC_COMPILE_ON_ERROR=true
RUN npm run build
# Production stage
FROM nginx:alpine
# Remove default nginx static assets
RUN rm -rf /usr/share/nginx/html/*
# Copy built assets
COPY --from=build /app/build /usr/share/nginx/html
# Copy nginx config
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Ensure nginx cache directory is writable for non-root user
RUN mkdir -p /var/cache/nginx/client_temp \
&& chown -R nginx:nginx /var/cache/nginx
# Switch to non-root user
USER nginx
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]