diff --git a/.gitignore b/.gitignore index 23038f4..287181f 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ node_modules .DS_Store .vscode application/config.js +.env 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 2558b35..1aa05df 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,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 +