weareoutman-clockpicker
SUCCESS
10m 37s
History Source
SummaryIterations1Transcript15Dockerfile
Dockerfile28 lines · 814 chars
# Multi-stage Dockerfile: build dist assets without gulp to avoid Node/Gulp incompatibility

FROM node:14-slim AS builder

WORKDIR /app

# Copy source files and the lightweight build script
COPY src ./src
COPY assets ./assets
COPY index.html index.html
COPY jquery.html jquery.html
COPY scripts/build-dist.js scripts/build-dist.js

# Build dist assets using a lightweight script that does not require npm install
RUN node scripts/build-dist.js

# Final stage: serve static files with nginx
FROM nginx:alpine

COPY --from=builder /app/dist /usr/share/nginx/html/dist
COPY --from=builder /app/assets /usr/share/nginx/html/assets
COPY --from=builder /app/index.html /usr/share/nginx/html/index.html
COPY --from=builder /app/jquery.html /usr/share/nginx/html/jquery.html

EXPOSE 80

CMD ["nginx", "-g", "daemon off;"]