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
RUN npm run build
FROM node:alpine AS runner
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"]
FROM nginx:alpine
WORKDIR /usr/share/nginx/html
RUN rm -rf ./*
COPY --from=builder /app/public .
EXPOSE 80
ENTRYPOINT ["nginx", "-g", "daemon off;"]

View File

@ -5,4 +5,4 @@ services:
image: localhost:5000/infoscreen:latest
restart: always
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