2021-12-28 17:35:40 +01:00
|
|
|
# ======Building the project=====
|
2021-12-28 19:02:05 +01:00
|
|
|
FROM node:17.3.0 AS builder
|
2021-12-28 17:35:40 +01:00
|
|
|
|
|
|
|
WORKDIR /usr/src/app
|
|
|
|
|
|
|
|
# Install Node dependencies
|
|
|
|
COPY package.json yarn.lock ./
|
|
|
|
RUN yarn install
|
|
|
|
|
|
|
|
# Copy over source code & build project
|
|
|
|
COPY vite.config.ts tsconfig.json index.html ./
|
|
|
|
COPY src/ ./src
|
|
|
|
COPY public/ ./public
|
|
|
|
RUN yarn run build
|
|
|
|
|
|
|
|
|
|
|
|
# =====Packaging inside an Nginx container=====
|
2022-01-25 22:00:52 +01:00
|
|
|
FROM nginx:1.21.6-alpine
|
2021-12-13 20:49:56 +01:00
|
|
|
|
2021-12-28 17:35:40 +01:00
|
|
|
# Copy over the Nginx config files
|
|
|
|
COPY nginx/nginx.conf /etc/nginx/nginx.conf
|
|
|
|
COPY nginx/*.conf.template /etc/nginx/templates/
|
|
|
|
COPY nginx/default.conf /etc/nginx/conf.d/default.conf
|
|
|
|
|
|
|
|
# Copy over build artifacts
|
|
|
|
COPY --from=builder /usr/src/app/dist /usr/share/nginx/html
|