-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
10 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,18 @@ | ||
# Build stage | ||
FROM node:lts-alpine AS build-stage | ||
# node:alpine3.19 | ||
FROM node@sha256:9b54d010b382f0ef176dc93cd829bd4f2a905092b260746b3999aa824c9b7121 AS build-stage | ||
WORKDIR /app | ||
# Copy package.json and package-lock.json (or yarn.lock) | ||
COPY web/start/package*.json ./ | ||
RUN npm install | ||
# Copy the rest of your app's source code | ||
COPY web/start/ . | ||
RUN ls -l | ||
RUN npm run build | ||
|
||
# Production stage | ||
FROM nginx:stable-alpine | ||
COPY --from=build-stage /app/build /usr/share/nginx/html | ||
COPY build/nginx.conf /etc/nginx/nginx.conf | ||
# nginx:alpine3.18 | ||
FROM nginx@sha256:2d2a2257c6e9d2e5b50d4fbeb436d8d2b55631c2a89935a425b417eb95212686 | ||
COPY --from=build-stage /app/dist /usr/share/nginx/html | ||
COPY --from=build-stage /app/nginx.conf /etc/nginx/nginx.conf | ||
EXPOSE 80 | ||
RUN chown -R nginx:nginx /usr/share/nginx/html && \ | ||
chmod -R 755 /usr/share/nginx/html | ||
USER nginx | ||
HEALTHCHECK --interval=30s --timeout=3s \ | ||
CMD curl -f http://localhost/ || exit 1 | ||
CMD ["nginx", "-g", "daemon off;"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.