- Easy Email forked from : https://github.com/m-Ryan/easy-email
- Docker for infrastructure
- Traefik for reverse proxy with auth middleware
- MySQL for database
- AdonisJS v6 for backend
- Docker
- Docker Compose
- Node.js v20.12.0 (or use NVM)
- Clone the repository
- Copy the
.env.example
file to.env
- Copy the
backend/.env.example
file tobackend/.env
and update the values - Install all dependencies
cd <project_root>
npm run install-all
cd backend
npm i
- Start the development server
cd <project_root>
cd docker
docker compose -f docker-compose.localhost.yml up
- Create the database by running the following command
cd <project_root>
cd backend
node ace migration:run
- Add one user into the database by running the following command
docker exec -it easy_email_mysql mysql -u easy_email -peasy_email easy_email_users
INSERT INTO users (email, full_name) VALUES ('[email protected]', 'John Doe');
- Copy the default images to the public folder
cd <project_root>
cp -r backend/uploads backend/public
- Start frontend & backend in two terminals
# In first terminal
cd <project_root>
npm run dev
# In second terminal
cd <project_root>
cd backend
npm run dev
- Go to http://localhost:3333
- Put the email you added in the database
- Go to your email and click on the magic link (if you are using mailtrap, you can see the email in the mailtrap.io inbox)
- You can now go to http://localhost:3000 and see the postcard app
- VPS server
- Domain linked to it
- Docker
- Docker Compose
- Github CLI
- A database server (MySQL, Postgres, etc.) with a database created and user with access to it
- Create a folder for the project "postcard"
- Copy content of docker-compose.prd.yml into docker-compose.yml
- Create .env file base from .env.example
- Generate a Personal Access Token (PAT) from Github
- Login to Github packages
echo "[PAT_TOKEN_HERE]" | docker login ghcr.io -u USERNAME --password-stdin
- Create uploads folder to store images
mkdir uploads
- Run the docker-compose
docker-compose up -d
- Run migration
docker exec -it postcard-auth node ace migration:run
docker run --rm -it mysql bash
mysql -h 51.159.113.67 --port 10792 -p -u innocean postcard
SELECT * FROM users;
INSERT INTO users (full_name, email, created_at) VALUES ('John', '[email protected]', NOW());
DELETE FROM users WHERE email = '[email protected]';
GHCR_TOKEN
: Github Personal Access Token to access Github packages And the following environment variables for staging / production in the repository settings:VITE_API_BASE_URL
: Backend base URL (e.g. https://postcard.innocean.app/auth)
- SSH into the VPS
- Create folder to store the config
mkdir -p ~/watchtower
cd ~/watchtower
- Create a .env file with the following content
REPO_USER=INNOCEAN-FRANCE
REPO_PASS=[PAT_TOKEN_HERE]
WATCHTOWER_INCLUDE_RESTARTING=true
- Run this following command
docker run -d --name watchtower-registr --env-file ~/watchtower/.env -v /var/run/docker.sock:/var/run/docker.sock containrrr/watchtower --interval 30 --cleanup
Now each time a new image is available, watchtower will pull it and restart the containers