tjo.space/Dockerfile
Tine 073e1bd2f7
All checks were successful
ci / docker (push) Successful in 6m3s
feat(analytics): caching
2024-02-06 13:34:15 +01:00

22 lines
645 B
Docker

FROM node:lts as build
# Reduce npm log spam and colour during install within Docker
ENV NPM_CONFIG_LOGLEVEL=warn
ENV NPM_CONFIG_COLOR=false
WORKDIR /home/node/app
COPY --chown=node:node . /home/node/app/
RUN npm install
RUN npm run typecheck
RUN npm run build
FROM nginx:stable as production
WORKDIR /home/node/app
# Copy nginx config
COPY --chown=nobody:nogroup nginx.conf /etc/nginx/conf.d/default.conf
# Copy what we've installed/built from production
COPY --chown=nobody:nogroup --from=build /home/node/app/build /usr/share/nginx/html/
# Caching directory
RUN mkdir -p /var/run/nginx-cache && chown nobody:nogroup /var/run/nginx-cache