Skip to content

Commit

Permalink
docs: setup README with setup guide and hosting guide
Browse files Browse the repository at this point in the history
  • Loading branch information
cdxker authored and skeptrunedev committed Nov 19, 2024
1 parent 6f0bad3 commit 7ba280b
Showing 1 changed file with 89 additions and 0 deletions.
89 changes: 89 additions & 0 deletions pdf2md/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Contributing to PDF2MD

## Project Setup

### Setup ENV's

```bash
cd server
cp .env.dist .env
```

### Start docker dependency services

- redis
- s3
- clickhouse-db

```bash
docker compose up -d
```

### Run Server + Workers

Strongly recommend using tmux or another multiplex system to handle the different proceses.

```bash
cargo watch -x run #HTTP server
cargo run --bin supervisor-worker
cargo run --bin chunk-worker
```

### Run tailwindcss server for demo UI

```
npx tailwindcss -i ./static/in.css -o ./static/output.css --watch
```

### Testing using the CLI

Make your changes then use the following to run:

```bash
cd cli
cargo run -- help #or other command instead of help
```

## Deploying

### docker-compose

```bash
docker compose up -f docker-compose-prod.yaml -d
```

You can either chose to build locally or pull the pre-built images from the docker hub.

#### Build Options
##### Build On Machine:

```bash
docker compose up -f docker-compose-prod.yaml -d --build
```

##### Use Pre-built Images:
```bash
docker compose up -f docker-compose-prod.yaml -d --pull always
```

#### Setup Caddy reverse proxy (optional)

Setup a Caddyfile with the following content:

```bash
# Global options
{
email [email protected]
}

# Define a site block for pdftomd.example.com
pdftomd.example.com {
reverse_proxy localhost:8081
}
```

Start the caddy reverse proxy. This should also handle your ssl

```bash
sudo systemctl reload caddy.service
```

0 comments on commit 7ba280b

Please sign in to comment.