29 lines
874 B
Docker
29 lines
874 B
Docker
# syntax=docker/dockerfile:1.4
|
|
# App image — node_modules from deps base (custom/shahoo-deps:1).
|
|
# Rebuild deps when yarn.lock changes: docker build -f Dockerfile.deps -t custom/shahoo-deps:1 .
|
|
ARG DEPS_IMAGE=custom/shahoo-deps:1
|
|
FROM ${DEPS_IMAGE} AS builder
|
|
|
|
WORKDIR /home/node
|
|
|
|
COPY --chown=node:node . .
|
|
|
|
ARG REACT_APP_API_URL=
|
|
ENV REACT_APP_API_URL=${REACT_APP_API_URL}
|
|
ARG REACT_APP_SKIP_API_KEY_2FA=
|
|
ENV REACT_APP_SKIP_API_KEY_2FA=${REACT_APP_SKIP_API_KEY_2FA}
|
|
ENV NODE_OPTIONS=--openssl-legacy-provider
|
|
|
|
USER node
|
|
|
|
RUN sed -i 's/\r$//' scripts/build.sh && sh scripts/build.sh
|
|
|
|
FROM nginx:mainline-alpine
|
|
|
|
COPY --from=builder /home/node/build /usr/share/nginx/html
|
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
EXPOSE 3000
|
|
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 \
|
|
CMD wget -q -O /dev/null http://127.0.0.1:3000/health || exit 1
|