website/Dockerfile.prod
FROM node:18-alpine
RUN apk update && \
apk add --no-cache git python build-base && \
mkdir -p /home/node/app
WORKDIR /home/node/app/website
# multiple copy statements because we want to cache
# from least likely to most likely to change
COPY ./website/static/ ./static/
COPY ./website/webpack/ ./webpack/
COPY ./website/scripts/ ./scripts/
COPY ./packages/ /home/node/app/packages/
COPY ./website/.postcssrc.js ./website/babel.config.js ./website/tsconfig.json ./
COPY ./website/package.json ./website/yarn.lock ./
RUN ls -la1; yarn --no-cache --frozen-lockfile
COPY ./website/src/ ./src
ARG DATA_API_BASE_URL
ARG GIT_COMMIT_HASH
RUN yarn build
FROM abiosoft/caddy:no-stats
COPY --from=0 /home/node/app/website/dist /srv/dist
COPY --from=0 /home/node/app/website/dist-timetable /srv/dist-timetable
COPY ./website/Caddyfile /etc/Caddyfile