Files
doneit-web/dockerfile
T
peter 504fda9c38
continuous-integration/drone/push Build is failing
update dockerfile
2026-04-14 10:55:34 +01:00

45 lines
975 B
Docker

# =========================
# BUILD STAGE
# =========================
FROM node:16 AS build
WORKDIR /app
# Avoid npm randomness
ENV NPM_CONFIG_LEGACY_PEER_DEPS=true
ENV NPM_CONFIG_AUDIT=false
ENV NPM_CONFIG_FUND=false
# Copy dependency files first (better caching)
COPY package*.json ./
# Clean install (IMPORTANT: single install only)
RUN npm cache clean --force
RUN npm install --legacy-peer-deps --no-audit --no-fund
# Copy full project
COPY . .
# Build Ionic Angular app
RUN npx ionic build --configuration production
# =========================
# PRODUCTION STAGE (NGINX)
# =========================
FROM nginx:alpine
# Nginx config (optional but recommended for SPA routing)
COPY ./nginx/default.conf /etc/nginx/conf.d/default.conf
# Clean default nginx files
RUN rm -rf /usr/share/nginx/html/*
# Copy build output from previous stage
COPY --from=build /app/www /usr/share/nginx/html
# Expose port
EXPOSE 80
# Start nginx
CMD ["nginx", "-g", "daemon off;"]