Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 38 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,52 @@ Random Port Generator

## Deployment

Simply run this compose.yml:
PortNote uses docker compose for deployment. It is crucial
to set up some secrets for the environment to make your
deployment work. One could do that by creating a `.env`
file with following content:

```dotenv
JWT_SECRET=# Replace with a secure random string
USER_SECRET=# Replace with a secure random string
LOGIN_USERNAME=# Replace with a username
LOGIN_PASSWORD=# Replace with a custom password
```

To quickly generate such file, one can execute a following
command:

> Note: it will overwrite the .env file if it already exists

```sh
echo """
JWT_SECRET=$(openssl rand -base64 32)
USER_SECRET=$(openssl rand -base64 32)
LOGIN_USERNAME=some_user
LOGIN_PASSWORD=some_password
""" > .en
```

Adjust the values to your needs and then run the following
[compose.yaml](compose.yml):

```yml
services:
web:
image: haedlessdev/portnote:latest
ports:
- "3000:3000"
env_file: .env
environment:
JWT_SECRET: RANDOM_SECRET # Replace with a secure random string
USER_SECRET: RANDOM_SECRET # Replace with a secure random string
LOGIN_USERNAME: username # Replace with a username
LOGIN_PASSWORD: mypassword # Replace with a custom password
DATABASE_URL: "postgresql://postgres:postgres@db:5432/postgres"
DATABASE_URL: "postgresql://postgres:[email protected]:5432/postgres"
depends_on:
db:
condition: service_started

agent:
image: haedlessdev/portnote-agent:latest
environment:
DATABASE_URL: "postgresql://postgres:postgres@db:5432/postgres"
DATABASE_URL: "postgresql://postgres:postgres@172.20.0.2:5432/postgres"
depends_on:
db:
condition: service_started
Expand All @@ -64,6 +89,12 @@ volumes:
postgres_data:
```

Deploy with a command:

```sh
docker compose -f compose.yml -d
```

## Tech Stack & Credits

The application is build with:
Expand Down
9 changes: 3 additions & 6 deletions compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,17 @@ services:
image: haedlessdev/portnote:latest
ports:
- "3000:3000"
env_file: .env
environment:
JWT_SECRET: RANDOM_SECRET # Replace with a secure random string
USER_SECRET: RANDOM_SECRET # Replace with a secure random string
LOGIN_USERNAME: username # Replace with a username
LOGIN_PASSWORD: mypassword # Replace with a custom password
DATABASE_URL: "postgresql://postgres:postgres@db:5432/postgres"
DATABASE_URL: "postgresql://postgres:[email protected]:5432/postgres"
depends_on:
db:
condition: service_started

agent:
image: haedlessdev/portnote-agent:latest
environment:
DATABASE_URL: "postgresql://postgres:postgres@db:5432/postgres"
DATABASE_URL: "postgresql://postgres:postgres@172.20.0.2:5432/postgres"
depends_on:
db:
condition: service_started
Expand Down