Skip to content

Commit

Permalink
docs: deploy (WIP)
Browse files Browse the repository at this point in the history
  • Loading branch information
tc-imba committed Aug 15, 2024
1 parent 40e4f6e commit 1a2121e
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 16 deletions.
41 changes: 31 additions & 10 deletions docs/config/index.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,50 @@
# Configuration

Usually a `.env` file is created in the project root directory.
## Setup

### Env File

Usually a `.env` file is created in the directory **`projects/sbos-playground`**.
The file can be used to configure the playground server.

For example, if the default server port should be changed from `9000` to `10000`,
the following line can be added in the `.env` file:
!!! warning

Make sure you place the `.env` file in the correct directory.


!!! example

If the default server port should be changed from `9000` to `10000`,
the following line can be added in the `.env` file:

```dotenv title=".env"
SERVER_PORT=10000
```

```dotenv title=".env"
SERVER_PORT=10000
```
### Environment Variables

Alternatively, environment variables can also be used, and its priority is higher.

```bash
export SERVER_PORT=10000
```
!!! example

```bash
export SERVER_PORT=10000
```

### Other

Configuration can also be setup in other places.

For detailed environment variables precedence rules, check the section [Environment Variables Precedence](#environment-variables-precedence).


## Configuration List

!!! note

If docker-compose is used to deploy the service, and the configuration entry is not listed in the compose file,
the entry should be added to the "environment" section manually.

## Configuration List

There are three types of configurations:

Expand Down
16 changes: 10 additions & 6 deletions docs/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,9 @@ cd playground

## Configuration

Create a `.env` file in the project root directory. The file can be used to configure the playground server.
The detailed configurable items can be found [here](config/index.md).
Playground can be configured with various options.
Please follow this [guide](config/index.md) to configure it.

```bash
touch .env
```

## Deploy the server

Expand All @@ -32,8 +29,15 @@ touch .env
and make sure the `docker-compose` version is at least `v2`

=== "Direct"

(Not yet completed)

The project is managed by `poetry` and `poe`.

```bash
poetry install
poe
```

Then, open `http://localhost:9000/brickapi/v1/docs`. If the swagger API page is shown, congratulations!
Now you can move to the [next step](init.md) in initialize playground.
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ cwd = "projects/sbos-playground"
cmd = "docker compose -f docker-compose.yml -f docker-compose-dev.yml up -d --build"
cwd = "projects/sbos-playground"

[tool.poe.tasks."playground:dev:local"]
cmd = "python -m sbos.playground serve"

[tool.poe.tasks."_playground:prod"]
cmd = "docker compose up -d"
cwd = "projects/sbos-playground"
Expand Down

0 comments on commit 1a2121e

Please sign in to comment.