Changeset View
Changeset View
Standalone View
Standalone View
web/cashtab/Dockerfile
| Show All 11 Lines | RUN apt-get update && \ | ||||
| apt-get install -y python | apt-get install -y python | ||||
| WORKDIR /app | WORKDIR /app | ||||
| # Copy only the package files and install necessary dependencies. | # Copy only the package files and install necessary dependencies. | ||||
| # This reduces cache busting when source files are changed. | # This reduces cache busting when source files are changed. | ||||
| COPY package.json . | COPY package.json . | ||||
| COPY package-lock.json . | COPY package-lock.json . | ||||
| RUN npm install | RUN npm ci | ||||
| # Copy the rest of the project files and build | # Copy the rest of the project files and build | ||||
| COPY . . | COPY . . | ||||
| RUN npm run build | RUN npm run build | ||||
| # Stage 2 | # Stage 2 | ||||
| FROM nginx | FROM nginx | ||||
| COPY nginx.conf /etc/nginx/conf.d/default.conf | COPY nginx.conf /etc/nginx/conf.d/default.conf | ||||
| # Set working directory to nginx asset directory | # Set working directory to nginx asset directory | ||||
| # Copy static assets from builder stage | # Copy static assets from builder stage | ||||
| COPY --from=builder /app/build /usr/share/nginx/html/ | COPY --from=builder /app/build /usr/share/nginx/html/ | ||||
| EXPOSE 80 | EXPOSE 80 | ||||
| # Containers run nginx with global directives and daemon off | # Containers run nginx with global directives and daemon off | ||||
| ENTRYPOINT ["nginx", "-g", "daemon off;"] | ENTRYPOINT ["nginx", "-g", "daemon off;"] | ||||