updated dockerfile
This commit is contained in:
parent
345f0495ed
commit
e7009dc214
34
Dockerfile
34
Dockerfile
@ -1,25 +1,19 @@
|
|||||||
FROM node:latest as builder
|
# ---- Base Node ----
|
||||||
|
FROM node:14 AS base
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
# ---- Dependencies ----
|
||||||
|
FROM base AS dependencies
|
||||||
|
COPY package*.json ./
|
||||||
|
RUN npm ci
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
RUN yarn install --frozen-lockfile
|
# ---- Build ----
|
||||||
RUN yarn build
|
FROM dependencies AS build
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
FROM node:alpine
|
# --- Release with Nginx ----
|
||||||
|
FROM nginx:1.16.0-alpine AS release
|
||||||
WORKDIR /app
|
COPY --from=build /app/build /usr/share/nginx/html/
|
||||||
|
EXPOSE 80
|
||||||
COPY --from=builder /app/package.json /app/yarn.lock ./
|
CMD ["nginx", "-g", "daemon off;"]
|
||||||
COPY --from=builder /app/build ./
|
|
||||||
|
|
||||||
RUN yarn install --frozen-lockfile --production
|
|
||||||
|
|
||||||
RUN apk add curl
|
|
||||||
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3\
|
|
||||||
CMD [ "curl", "--fail", "--silent", "--output", "/dev/null", "localhost:3000/api/health" ]
|
|
||||||
|
|
||||||
EXPOSE 3000
|
|
||||||
|
|
||||||
CMD ["node", "./index.js"]
|
|
Loading…
Reference in New Issue
Block a user