Add docker files

This commit is contained in:
Liam 2022-11-14 02:30:07 +00:00
parent 63c94365ce
commit d10593dd7c
3 changed files with 59 additions and 0 deletions

23
.dockerignore Normal file
View File

@ -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

10
Dockerfile Normal file
View File

@ -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"]

26
docker-compose.yml Normal file
View File

@ -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