Use nginx

This commit is contained in:
Daniel Kluge 2022-01-06 21:06:55 +01:00
parent 2ae43c6e22
commit d13bc2d312
2 changed files with 7 additions and 13 deletions

View File

@ -7,15 +7,9 @@ COPY . .
ENV GATSBY_TELEMETRY_DISABLED 1 ENV GATSBY_TELEMETRY_DISABLED 1
RUN npm run build RUN npm run build
FROM node:alpine AS runner FROM nginx:alpine
WORKDIR /app WORKDIR /usr/share/nginx/html
RUN addgroup -g 1001 -S gatsby RUN rm -rf ./*
RUN adduser -S gatsby -u 1001 COPY --from=builder /app/public .
COPY --from=builder /app/public ./public EXPOSE 80
COPY --from=builder /app/node_modules ./node_modules ENTRYPOINT ["nginx", "-g", "daemon off;"]
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"]

View File

@ -5,4 +5,4 @@ services:
image: localhost:5000/infoscreen:latest image: localhost:5000/infoscreen:latest
restart: always restart: always
ports: ports:
- 11460:9000 # 1, 14th char in alphabet, 6th char in alphabet, 0 - 11460:80 # 1, 14th char in alphabet, 6th char in alphabet, 0