The platform for build podcast from yourtube playlist.
- Docker
- GitHub action for deploy docker image to GitHub registry and push image to VPS
- MongoDB as storage for data and files
Project use docker secrets for storing sensitive data. For local development create .secret.json file in the root of the project.
In case you want to getting secret from other file change the .env file.
Sample of .secret.json file:
{
"mongoUri": "mongodb://<user>:<pass>@<ip>:27017/<dbname>?<spec-param>",
"google": {
"clientId": "<google client id>"
},
"youtubeApiKey": "<youtube api key>",
"rapidApiKey": "<rapid api key>",
"baseUrl": "http://localhost:3000"
}cat .prod-secret.json | docker secret create ypod-secret -Enfure the following install:
- Node.js
- npm
Run the following command to install all dependencies:
npm installRun the following command to start the project:
npm run devApp will be available on http://localhost:3000
Create a new database in mongo db and add a new user with readWrite role.
use <dbname>db.createUser({
user: "<specUser>",
pwd: "<specPass>",
roles: [
{ role: "readWrite", db: "<dbname>" }
]
});
```
# Deloyment
Create a new VPS with Ubuntu 22.04
Create a deploy user
```sh
adduser deployAdd user to docker group
usermod -aG docker deployCreate a new ssh key for deploy user.
File to add public key: /home/deploy/.ssh/authorized_keys (on the server)
Add private SSH key to GitHub Secrets as DEPLOY_SSH_PRIVATE_KEY
Add secrets to GitHub repository:
DEPLOY_SSH_PRIVATE_KEY - private ssh key for deploy user