diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..3a78c9d --- /dev/null +++ b/.dockerignore @@ -0,0 +1,13 @@ +node_modules +npm-debug.log +Dockerfile* +docker-compose* +.dockerignore +.git +.gitignore +.env +*/bin +*/obj +README.md +LICENSE +.vscode \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c587345 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +FROM node:11 +ENV NODE_ENV production +WORKDIR /usr/src/app +COPY ["package.json", "package-lock.json*", "npm-shrinkwrap.json*", "./"] +RUN npm install --production --silent && mv node_modules ../ +COPY . . +EXPOSE 3000 +CMD npm start \ No newline at end of file diff --git a/docker-compose.debug.yml b/docker-compose.debug.yml new file mode 100644 index 0000000..5bed53f --- /dev/null +++ b/docker-compose.debug.yml @@ -0,0 +1,12 @@ +version: '2.1' + +services: + christmas-community: + image: christmas-community + build: . + environment: + NODE_ENV: development + ports: + - 3000:3000 + - 9229:9229 + command: node --inspect=0.0.0.0:9229 index.js \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..35ea965 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,10 @@ +version: '2.1' + +services: + christmas-community: + image: christmas-community + build: . + environment: + NODE_ENV: production + ports: + - 3000:3000 \ No newline at end of file