This repository has been archived on 2022-09-04. You can view files and clone it, but cannot push or open issues or pull requests.
version.tribalwarshelp.com/Dockerfile

43 lines
1005 B
Docker

FROM node:14.18.2-alpine as build-deps
#Stage 1
WORKDIR /usr/src/app
COPY package.json yarn.lock ./
RUN yarn
COPY . ./
ARG VERSION="0.0.0"
ARG SENTRY_ENABLED="false"
ARG SENTRY_URL=""
ARG SENTRY_ORG=""
ARG SENTRY_PROJECT=""
ARG SENTRY_AUTH_TOKEN=""
ARG SENTRY_DSN=""
ARG PLAUSIBLE_ENABLED="false"
ARG PLAUSIBLE_DOMAIN=""
ARG PLAUSIBLE_SCRIPT_SRC=""
ENV REACT_APP_SENTRY_ENABLED=$SENTRY_ENABLED \
SENTRY_URL=$SENTRY_URL \
SENTRY_ORG=$SENTRY_ORG \
SENTRY_PROJECT=$SENTRY_PROJECT \
SENTRY_AUTH_TOKEN=$SENTRY_AUTH_TOKEN \
REACT_APP_SENTRY_DSN=$SENTRY_DSN \
REACT_APP_PLAUSIBLE_ENABLED=$PLAUSIBLE_ENABLED \
REACT_APP_PLAUSIBLE_DOMAIN=$PLAUSIBLE_DOMAIN \
REACT_APP_PLAUSIBLE_SCRIPT_SRC=$PLAUSIBLE_SCRIPT_SRC \
REACT_APP_VERSION=$VERSION \
NODE_ENV=production
RUN yarn build
#Stage 2
FROM nginx:1.21-alpine
COPY --from=build-deps /usr/src/app/build /var/www
COPY default.conf /etc/nginx/templates/default.conf.template
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]