mempool/docker/frontend/Dockerfile

39 lines
1017 B
Docker
Raw Normal View History

FROM node:16.15.0-buster-slim AS builder
2021-06-26 08:47:19 +02:00
ARG commitHash
ENV DOCKER_COMMIT_HASH=${commitHash}
ENV CYPRESS_INSTALL_BINARY=0
2021-06-26 08:47:19 +02:00
WORKDIR /build
COPY . .
RUN apt-get update
RUN apt-get install -y build-essential rsync
RUN npm i
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/
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 && \
chown -R 1000:1000 /etc/nginx/nginx.conf && \
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;"]