Merge pull request #15 from jmbit/docker

Added docker compose and Dockerfile
pull/16/head
Clara K 2024-09-17 21:19:26 +02:00 committed by GitHub
commit 98769782cc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 36 additions and 3 deletions

7
.gitignore vendored
View File

@ -1,5 +1,8 @@
node_modules
.env
.idea
.DS_Store
.vscode
.DS_Store
node_modules
application/config.js

8
Dockerfile Normal file
View File

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

View File

@ -77,6 +77,15 @@ WantedBy=multi-user.target
<br><br>
- #### 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

13
docker-compose.yml Normal file
View File

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