mempool/docker/backend/Dockerfile
Erik Arvstedt 34c8ad614a
backend: Rename build variable DOCKER_COMMIT_HASH -> MEMPOOL_COMMIT_HASH
This var is useful for all build methods, not only Docker.

This is an internal renaming that doesn't change the public Docker
backend image API.
2022-09-02 12:50:44 +02:00

27 lines
555 B
Docker

FROM node:16.16.0-buster-slim AS builder
ARG commitHash
ENV MEMPOOL_COMMIT_HASH=${commitHash}
WORKDIR /build
COPY . .
RUN apt-get update
RUN apt-get install -y build-essential python3 pkg-config
RUN npm install --omit=dev --omit=optional
RUN npm run package
FROM node:16.16.0-buster-slim
WORKDIR /backend
RUN chown 1000:1000 ./
COPY --from=builder --chown=1000:1000 /build/package ./package/
COPY --from=builder --chown=1000:1000 /build/mempool-config.json /build/start.sh /build/wait-for-it.sh ./
USER 1000
EXPOSE 8999
CMD ["/backend/start.sh"]