2022-07-08 17:22:56 +02:00
|
|
|
FROM node:16.16.0-buster-slim AS builder
|
2021-02-01 17:25:08 +01:00
|
|
|
|
2021-06-26 08:47:19 +02:00
|
|
|
ARG commitHash
|
|
|
|
ENV DOCKER_COMMIT_HASH=${commitHash}
|
2021-06-27 01:48:57 +02:00
|
|
|
ENV CYPRESS_INSTALL_BINARY=0
|
2021-06-26 08:47:19 +02:00
|
|
|
|
2021-02-01 17:25:08 +01:00
|
|
|
WORKDIR /build
|
|
|
|
COPY . .
|
|
|
|
RUN apt-get update
|
|
|
|
RUN apt-get install -y build-essential rsync
|
2022-07-07 18:32:18 +02:00
|
|
|
RUN npm install --omit=dev --omit=optional
|
2021-02-01 17:25:08 +01:00
|
|
|
RUN npm run build
|
|
|
|
|
|
|
|
FROM nginx:1.17.8-alpine
|
|
|
|
|
|
|
|
WORKDIR /patch
|
|
|
|
|
|
|
|
COPY --from=builder /build/entrypoint.sh .
|
|
|
|
COPY --from=builder /build/wait-for .
|
|
|
|
COPY --from=builder /build/dist/mempool /var/www/mempool
|
2021-02-03 02:12:15 +01:00
|
|
|
COPY --from=builder /build/nginx.conf /etc/nginx/
|
|
|
|
COPY --from=builder /build/nginx-mempool.conf /etc/nginx/conf.d/
|
2021-02-01 17:25:08 +01:00
|
|
|
|
|
|
|
RUN chmod +x /patch/entrypoint.sh
|
|
|
|
RUN chmod +x /patch/wait-for
|
|
|
|
|
|
|
|
RUN chown -R 1000:1000 /patch && chmod -R 755 /patch && \
|
|
|
|
chown -R 1000:1000 /var/cache/nginx && \
|
|
|
|
chown -R 1000:1000 /var/log/nginx && \
|
2021-02-10 14:51:01 +01:00
|
|
|
chown -R 1000:1000 /etc/nginx/nginx.conf && \
|
2021-02-01 17:25:08 +01:00
|
|
|
chown -R 1000:1000 /etc/nginx/conf.d
|
|
|
|
RUN touch /var/run/nginx.pid && \
|
|
|
|
chown -R 1000:1000 /var/run/nginx.pid
|
|
|
|
|
|
|
|
USER 1000
|
|
|
|
|
|
|
|
ENTRYPOINT ["/patch/entrypoint.sh"]
|
|
|
|
CMD ["nginx", "-g", "daemon off;"]
|