-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update dockerfile in katbin to include default DATABASE_URL; update R…
…EADME
- Loading branch information
liuwen
committed
Aug 23, 2024
1 parent
561e65a
commit e5aa6ab
Showing
3 changed files
with
73 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,76 @@ | ||
# Katbin | ||
|
||
This directory contains the configuration for Katbin, a pastebin service written in Elixir, as part of the versatile package manager. | ||
This directory contains the configuration for Katbin, a pastebin service written in Elixir. | ||
|
||
## Features | ||
## Prerequisites | ||
|
||
- Pastebin functionality | ||
- Written in Elixir | ||
- Containerized for easy deployment | ||
- Docker and Docker Compose installed | ||
- Access to the Katbin Docker image | ||
|
||
## Files | ||
## Setup and Usage | ||
|
||
- `Dockerfile`: Defines the Katbin build and runtime environment | ||
- `source/`: Git submodule containing the Katbin source code | ||
1. Create a `docker-compose.yml` file: | ||
|
||
## Usage | ||
```yaml | ||
|
||
1. Ensure you've initialized and updated the git submodule: | ||
services: | ||
katbin-db: | ||
image: postgres:16-alpine | ||
container_name: katbin-db | ||
environment: | ||
POSTGRES_DB: katbin | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: katbin | ||
volumes: | ||
- postgres_data:/var/lib/postgresql/data | ||
networks: | ||
- katbin-network | ||
|
||
katbin: | ||
image: ghcr.io/somehow22/katbin | ||
depends_on: | ||
- katbin-db | ||
ports: | ||
- "8080:8080" | ||
env_file: | ||
- .env | ||
networks: | ||
- katbin-network | ||
|
||
volumes: | ||
postgres_data: | ||
|
||
networks: | ||
katbin-network: | ||
``` | ||
2. Generate a SECRET_KEY_BASE: | ||
``` | ||
openssl rand -base64 64 | ||
``` | ||
Copy the output for use in the next step. | ||
|
||
3. Create a `.env` file and configure the environment variables: | ||
``` | ||
git submodule update --init --recursive | ||
DATABASE_URL=postgres://postgres:katbin@db:5432/katbin | ||
SECRET_KEY_BASE=<paste_generated_secret_here> | ||
SWOOSH_USERNAME=your_email@example.com | ||
SWOOSH_PASSWORD=your_email_password | ||
SWOOSH_SMTP_RELAY=smtp.your-email-provider.com | ||
``` | ||
2. Build the Docker image using the provided Dockerfile | ||
3. Run the container, exposing the necessary ports | ||
Be sure to replace the placeholders with your actual SMTP credentials. | ||
|
||
4. Start the services: | ||
``` | ||
docker-compose up -d | ||
``` | ||
|
||
5. Check the logs: | ||
``` | ||
docker-compose logs -f katbin | ||
``` | ||
Look for any error messages or confirmation that the service has started successfully. | ||
|
||
6. Access Katbin at `http://localhost:8080` | ||
|
||
For more details on Katbin, please refer to the original project: [https://github.com/sphericalkat/katbin](https://github.com/sphericalkat/katbin) |