Changed Docker build process
This commit is contained in:
parent
92b4f864b2
commit
dbc214753f
1 changed files with 17 additions and 4 deletions
21
Dockerfile
21
Dockerfile
|
@ -1,9 +1,22 @@
|
|||
FROM nginx:alpine
|
||||
# Install Node
|
||||
RUN apk add --update npm
|
||||
WORKDIR /build
|
||||
# Dependencies
|
||||
COPY package.json package.json
|
||||
COPY package-lock.json package-lock.json
|
||||
RUN npm i
|
||||
# Copy react build assets
|
||||
COPY public public
|
||||
COPY src src
|
||||
COPY index.html .
|
||||
COPY vite.config.js .
|
||||
# Build static web files
|
||||
RUN npm run build:react
|
||||
# Set working directory to nginx asset directory
|
||||
WORKDIR /usr/share/nginx/html
|
||||
# Remove default nginx static assets
|
||||
WORKDIR /usr/share/nginx/html
|
||||
RUN rm -rf ./*
|
||||
# Copy static assets over
|
||||
COPY dist .
|
||||
RUN mv /build/dist/* .
|
||||
# Containers run nginx with global directives and daemon off
|
||||
ENTRYPOINT ["nginx", "-g", "daemon off;"]
|
||||
ENTRYPOINT ["nginx", "-g", "daemon off;"]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue