diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..cbd3fdd --- /dev/null +++ b/.dockerignore @@ -0,0 +1,23 @@ +**/.classpath +**/.dockerignore +**/.env +**/.git +**/.gitignore +**/.project +**/.settings +**/.toolstarget +**/.vs +**/.vscode +**/*.*proj.user +**/*.dbmdl +**/*.jfm +**/charts +**/docker-compose* +**/compose* +**/Dockerfile* +**/node_modules +**/npm-debug.log +**/obj +**/secrets.dev.yaml +**/values.dev.yaml +README.md diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..cdb92a8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM node:lts-alpine +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 +RUN chown -R node /usr/src/app +USER node +CMD ["npm", "start"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..26344c2 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,26 @@ +version: "3.4" + +services: + imageify: + image: imageify + restart: always + build: + context: . + dockerfile: ./Dockerfile + environment: + NODE_ENV: production + env_file: + - .env + ports: + - 3000:3000 + volumes: + - ./.storage:/.storage + + mongo: + image: mongo:latest + restart: always + environment: + MONGO_INITDB_ROOT_USERNAME: imageify + MONGO_INITDB_ROOT_PASSWORD: reallysecuremongopassword + volumes: + - ./mongodb:/data