diff --git a/.gitignore b/.gitignore index 2480aa1..1eb68c7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,8 @@ -node_modules +.env .idea -.DS_Store .vscode -application/config.js \ No newline at end of file +.DS_Store + +node_modules +application/config.js + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9de4526 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +FROM node:22 + +COPY . /home/node/app +RUN chown -R node:node /home/node/app +WORKDIR /home/node/app +USER node +RUN npm i +CMD ["npm", "run", "start"] diff --git a/README.md b/README.md index 60b6b96..dcfdcb6 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,15 @@ WantedBy=multi-user.target

+- #### Docker: + - `git clone https://github.com/Crazyco-xyz/48hr.email.git` + - `cd 48hr.email` + - Change all settings to the desired values: + - Either use environmental variables, or modify `application/config.js` + - `docker compose up -d` + - If desired, you can also move the config file somewhere else (change volume mount accordingly) + + ----- ### TODO: - Clean up codebase diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..8ef6f58 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,13 @@ +services: + 48hr: + ## Map environment variables from file (e.g. for imap password) + #env_file: ./.env + image: localhost/48hr + restart: always + build: . + ports: + - 3000:3000 + ## Map config file from project to docker container + volumes: + - ./application/config.js:/home/node/app/application/config.js +