Dockerize the whole web application
This commit is contained in:
parent
0640b80958
commit
cba3e70511
13
.dockerignore
Normal file
13
.dockerignore
Normal file
|
@ -0,0 +1,13 @@
|
|||
# docker files
|
||||
Dockerfile
|
||||
docker-compose.yml
|
||||
|
||||
# git files
|
||||
branches
|
||||
config
|
||||
descriptiom
|
||||
HEAD
|
||||
hooks
|
||||
info
|
||||
objects
|
||||
refs
|
18
Dockerfile
Normal file
18
Dockerfile
Normal file
|
@ -0,0 +1,18 @@
|
|||
# build stage
|
||||
FROM node:lts-alpine as build-stage
|
||||
WORKDIR /app
|
||||
COPY package*.json ./
|
||||
RUN npm install
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
# production stage
|
||||
FROM nginx:stable-alpine as production-stage
|
||||
COPY --from=build-stage /app/dist /usr/share/nginx/html
|
||||
# use custom error code websites instead
|
||||
RUN rm -f /usr/share/nginx/html/50x.html
|
||||
# update default.conf nginx file with necessary try_files statement
|
||||
RUN rm -f /etc/nginx/conf.d/default.conf
|
||||
COPY ./default.conf /etc/nginx/conf.d/default.conf
|
||||
EXPOSE 80
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
15
docker-compose.yml
Normal file
15
docker-compose.yml
Normal file
|
@ -0,0 +1,15 @@
|
|||
networks:
|
||||
openvisorwebsite-network:
|
||||
name: openvisorwebsite-network
|
||||
driver: bridge
|
||||
external: false
|
||||
attachable: false
|
||||
|
||||
services:
|
||||
openvisorwebsite-app:
|
||||
container_name: openvisorwebsite-app
|
||||
build: .
|
||||
ports:
|
||||
- 1443:80
|
||||
networks:
|
||||
- openvisorwebsite-network
|
Loading…
Reference in a new issue