Updated Dockerfile to build frontend
This commit is contained in:
parent
9af76b09f2
commit
f9acc17263
6 changed files with 130 additions and 7 deletions
21
Dockerfile
21
Dockerfile
|
|
@ -1,3 +1,24 @@
|
|||
# ======Building the project=====
|
||||
FROM node:17.2.0 AS builder
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
# Install Node dependencies
|
||||
COPY package.json yarn.lock ./
|
||||
RUN yarn install
|
||||
|
||||
# Copy over source code & build project
|
||||
COPY astro.config.mjs tsconfig.json ./
|
||||
COPY src/ ./src
|
||||
RUN yarn run build
|
||||
|
||||
|
||||
# =====Packaging inside an Nginx container=====
|
||||
FROM nginx:1.21.4-alpine
|
||||
|
||||
# Copy over the Nginx config files
|
||||
COPY nginx.conf /etc/nginx/nginx.conf
|
||||
COPY default.conf.template /etc/nginx/templates/default.conf.template
|
||||
|
||||
# Copy over build artifacts
|
||||
COPY --from=builder /usr/src/app/dist /usr/share/nginx/html
|
||||
|
|
|
|||
Reference in a new issue