Dockerfile
FROM node:18.15.0-alpine3.17
# app
ARG APP_BASE_PATH
ENV APP_BASE_PATH="${APP_BASE_PATH}"
ARG APP_DEV_SERVER_PORT
ENV APP_DEV_SERVER_PORT="${APP_DEV_SERVER_PORT}"
ARG APP_HOST="0.0.0.0"
ENV APP_HOST="${APP_HOST}"
ARG APP_MORGAN_FORMAT="combined"
ENV APP_MORGAN_FORMAT="${APP_MORGAN_FORMAT}"
ARG APP_PORT=8080
ENV APP_PORT="${APP_PORT}"
ARG APP_PUBLIC_PATH
ENV APP_PUBLIC_PATH="${APP_PUBLIC_PATH}"
ARG APP_REVISION
ENV APP_REVISION="${APP_REVISION}"
ARG APP_VERSION
ENV APP_VERSION="${APP_VERSION}"
# api
ARG APP_API_PORT=8081
ENV APP_API_PORT="${APP_API_PORT}"
ARG APP_API_PROXY_DISABLED=0
ENV APP_API_PROXY_DISABLED="${APP_API_PROXY_DISABLED}"
ARG APP_API_PROXY_PATH="/api"
ENV APP_API_PROXY_PATH="${APP_API_PROXY_PATH}"
ARG APP_API_PROXY_TARGET="http://0.0.0.0:8081"
ENV APP_API_PROXY_TARGET="${APP_API_PROXY_TARGET}"
ARG APP_API_TARGET="http://0.0.0.0:8081"
ENV APP_API_TARGET="${APP_API_TARGET}"
# other
ARG BABEL_ENV="production"
ENV BABEL_ENV="${BABEL_ENV}"
ARG NODE_ENV="production"
ENV NODE_ENV="${NODE_ENV}"
ARG NODE_PATH="./src"
ENV NODE_PATH="${NODE_PATH}"
ARG UNIVERSAL_WEBPACK_CSS_LOADER_V4="true"
ENV UNIVERSAL_WEBPACK_CSS_LOADER_V4="${UNIVERSAL_WEBPACK_CSS_LOADER_V4}"
WORKDIR /srv/universal-redux/
COPY . .
RUN yarn cache clean \
&& NODE_ENV="development" yarn install --ignore-scripts --network-timeout 240000 \
&& yarn build
CMD ["/usr/local/bin/yarn", "start"]