This commit is contained in:
parent
f8dacef309
commit
37350f59c3
3 changed files with 83 additions and 0 deletions
15
deploy/prod/Dockerfile.frontend
Normal file
15
deploy/prod/Dockerfile.frontend
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
# Use an official Node.js runtime as instance_a parent image
|
||||
FROM node:14
|
||||
|
||||
# Set work directory
|
||||
WORKDIR /app
|
||||
|
||||
# Install app dependencies
|
||||
# A wildcard is used to ensure both package.json AND package-lock.json are copied
|
||||
COPY package.json ./
|
||||
|
||||
RUN npm install
|
||||
# If you are building your code for production
|
||||
# RUN npm ci --only=production
|
||||
|
||||
CMD [ "npm", "run", "dev", "--", "--host"]
|
||||
14
deploy/prod/Dockerfile.frontend.prod
Normal file
14
deploy/prod/Dockerfile.frontend.prod
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
ROM node:alpine as builder
|
||||
WORKDIR /app
|
||||
COPY ./package.json /app/package.json
|
||||
COPY . /app
|
||||
RUN npm ci --only=production
|
||||
RUN npm run build
|
||||
|
||||
|
||||
FROM nginx:alpine as runner
|
||||
#RUN apk add --update npm
|
||||
WORKDIR /app
|
||||
COPY --from=builder /app/dist /usr/share/nginx/html
|
||||
COPY ./nginx.conf /etc/nginx/nginx.conf
|
||||
EXPOSE 80
|
||||
Loading…
Add table
Add a link
Reference in a new issue