Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create docker deployment generator #119

Merged
merged 8 commits into from
Dec 11, 2023
Merged
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
8 changes: 8 additions & 0 deletions .github/workflows/ci-generators.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,11 @@ jobs:
env:
REDIS_URL: redis://localhost:${{job.services.redis.ports[6379]}}
DATABASE_URL: postgres://postgress:postgress@localhost:5432/postgress_test

- name: docker deployment
run: cargo run -- generate deployment
working-directory: ./examples/demo
env:
LOCO_DEPLOYMENT_KIND: docker
REDIS_URL: redis://localhost:${{job.services.redis.ports[6379]}}
DATABASE_URL: postgres://postgress:postgress@localhost:5432/postgress_test
115 changes: 115 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ cargo_metadata = "0.18.1"
cfg-if = "1"

uuid = { version = "1.6", features = ["v4"] }
requestty = "0.5.0"


[dependencies.sea-orm-migration]
Expand Down
31 changes: 23 additions & 8 deletions docs-site/content/docs/getting-started/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,14 @@ We took special care that **all of your work** is embbedded in a **single** bina

There are a few configuration sections that are important to review and set accordingly when deploying to production:

* Logger:
- Logger:

```yaml
logger:
level: <your production log level>
level: <your production log level>
```


* Server:
- Server:

```yaml
server:
Expand All @@ -48,15 +47,15 @@ server:
host: http://localhost
```

* Database:
- Database:

```yaml
database:
# Database connection URI
uri: postgres://loco:loco@localhost:5432/loco_app
```

* Mailer:
- Mailer:

```yaml
mailer:
Expand All @@ -68,15 +67,15 @@ mailer:
host: localhost
```

* Redis:
- Redis:

```
redis:
# Redis connection URI
uri: redis://127.0.0.1/
```

* JWT secret:
- JWT secret:

```yaml
auth:
Expand All @@ -85,3 +84,19 @@ auth:
# Secret key for token generation and verification
secret: ...
```

## Generate

Loco offers a deployment template enabling the creation of a deployment infrastructure.

Presently, we exclusively support Docker deployment, but stay tuned for future updates! 🙂

```sh
cargo loco generate deployment
? ❯ Choose your deployment ›
❯ Docker
..
✔ ❯ Choose your deployment · Docker
skipped (exists): "dockerfile"
added: ".dockerignore"
```
Loading
Loading