update app with docker files

This commit is contained in:
Amruth Pillai 2020-03-31 13:58:14 +05:30
parent 19d84748c0
commit 2e624e6f6f
No known key found for this signature in database
GPG Key ID: 09959E21662F51A0
3 changed files with 37 additions and 0 deletions

1
.dockerignore Normal file
View File

@ -0,0 +1 @@
node_modules

21
Dockerfile Normal file
View File

@ -0,0 +1,21 @@
## base image
FROM node:13.12.0-buster-slim
## set working directory
WORKDIR /usr/src/app
## add `/usr/src/app/node_modules/.bin` to $PATH
ENV PATH /usr/src/app/node_modules/.bin:$PATH
## install and cache app dependencies
COPY package.json /usr/src/app/package.json
## create user "node" and give permissions
RUN chown -R node:node . && chmod -R 755 .
USER node
# install app dependencies
RUN npm install
## start app
CMD ["npm", "start"]

15
docker-compose.yml Normal file
View File

@ -0,0 +1,15 @@
version: '3.7'
services:
reactive-resume:
container_name: reactive-resume
build:
context: .
dockerfile: Dockerfile
volumes:
- '.:/usr/src/app'
- '/usr/src/app/node_modules'
ports:
- '3001:3000'
environment:
- NODE_ENV=development