Skip to content

Commit

Permalink
update start process
Browse files Browse the repository at this point in the history
  • Loading branch information
nstoik committed Mar 19, 2024
1 parent d61482a commit 5a515b5
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 3 deletions.
32 changes: 30 additions & 2 deletions device/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,33 @@ The available app commands are:
- ```pipenv install --dev``` - install dev dependencies
- ```pipenv run {command}``` - run a command in the virtual environment
- ```fd_device``` - commands for the device
- ```fd_device --help``` - help for the device commands


To see all available commands type: `fd_device`

```bash
> cd device
> pipenv shell
> pipenv install --dev
> fd_device
Usage: fd_device [OPTIONS] COMMAND [ARGS]...

Entry point for CLI.

Options:
--help Show this message and exit.

Commands:
database Command group for database commands.
first-setup First time setup.
lint Lint and check code style with black, flake8 and isort.
run Run the server.
test Run the tests.
```



## Docker startup command
The startup script [`start.sh`](./start.sh) is used to start the application. It
waits for the database to be ready, applies any migrations, and then starts the application using the `fd_device run` command.

The `start.sh` script is the entrypoint for the docker container.
10 changes: 9 additions & 1 deletion device/start.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/bash

# A start up script for the fd_device container.
# This script is run when the container is started.
# It will wait for the database to be ready, then run any migrations
Expand All @@ -16,4 +18,10 @@ pipenv run fd_device database database_upgrade --revision head

# Start fd_device
echo "Starting fd_device..."
pipenv run fd_device run
pipenv run fd_device run

# Wait for the fd_device process to finish
echo "Waiting for fd_device to finish..."
wait $!

echo "fd_device has finished, exiting..."

0 comments on commit 5a515b5

Please sign in to comment.