Fix docker file for successfull build

This commit is contained in:
Daniel Kluge 2022-01-06 20:21:37 +01:00
parent 5cd6098601
commit f3a919e24f

View File

@ -1,4 +1,21 @@
FROM gatsbyjs/gatsby:onbuild as build FROM node:alpine AS builder
RUN apk add --no-cache libc6-compat
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
COPY . .
ENV GATSBY_TELEMETRY_DISABLED 1
RUN npm run build
FROM gatsbyjs/gatsby FROM node:alpine AS runner
COPY --from=build /app/public /pub WORKDIR /app
RUN addgroup -g 1001 -S gatsby
RUN adduser -S gatsby -u 1001
COPY --from=builder /app/public ./public
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package.json ./package.json
USER gatsby
EXPOSE 9000
ENV PORT 9000
ENV GATSBY_TELEMETRY_DISABLED 1
CMD ["node_modules/.bin/gatsby", "serve"]