Skip to content

Commit cb293f2

Browse files
authored
Merge pull request #1 from whythawk/br3ndonland/inboard
Update back-end for inboard and Python 3.9
2 parents 490c554 + 2cbf37f commit cb293f2

File tree

9 files changed

+1837
-58
lines changed

9 files changed

+1837
-58
lines changed

Diff for: .gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.vscode
22
testing-project
33
.mypy_cache
4-
poetry.lock
4+
# poetry.lock
55
dev-link/

Diff for: {{cookiecutter.project_slug}}/.env

+2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ DOCKER_IMAGE_CELERYWORKER={{cookiecutter.docker_image_celeryworker}}
1414
DOCKER_IMAGE_FRONTEND={{cookiecutter.docker_image_frontend}}
1515

1616
# Backend
17+
BACKEND_APP_MODULE=app.main:app
1718
BACKEND_CORS_ORIGINS={{cookiecutter.backend_cors_origins}}
19+
BACKEND_PRE_START_PATH=/app/prestart.sh
1820
PROJECT_NAME={{cookiecutter.project_name}}
1921
SECRET_KEY={{cookiecutter.secret_key}}
2022
FIRST_SUPERUSER={{cookiecutter.first_superuser}}

Diff for: {{cookiecutter.project_slug}}/README.md

+1-21
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,7 @@ During development, you can change Docker Compose settings that will only affect
8282

8383
The changes to that file only affect the local development environment, not the production environment. So, you can add "temporary" changes that help the development workflow.
8484

85-
For example, the directory with the backend code is mounted as a Docker "host volume", mapping the code you change live to the directory inside the container. That allows you to test your changes right away, without having to build the Docker image again. It should only be done during development, for production, you should build the Docker image with a recent version of the backend code. But during development, it allows you to iterate very fast.
86-
87-
There is also a command override that runs `/start-reload.sh` (included in the base image) instead of the default `/start.sh` (also included in the base image). It starts a single server process (instead of multiple, as would be for production) and reloads the process whenever the code changes. Have in mind that if you have a syntax error and save the Python file, it will break and exit, and the container will stop. After that, you can restart the container by fixing the error and running again:
85+
For example, the directory with the backend code is mounted as a Docker "host volume", mapping the code you change live to the directory inside the container. That allows you to test your changes right away, without having to build the Docker image again. It should only be done during development, for production, you should build the Docker image with a recent version of the backend code. But during development, it allows you to iterate very fast. Have in mind that if you have a syntax error and save the Python file, it will break and exit, and the container will stop. After that, you can restart the container by fixing the error and running again:
8886

8987
```console
9088
$ docker-compose up -d
@@ -112,24 +110,6 @@ root@7f2607af31c3:/app#
112110

113111
that means that you are in a `bash` session inside your container, as a `root` user, under the `/app` directory.
114112

115-
There you can use the script `/start-reload.sh` to run the debug live reloading server. You can run that script from inside the container with:
116-
117-
```console
118-
$ bash /start-reload.sh
119-
```
120-
121-
...it will look like:
122-
123-
```console
124-
root@7f2607af31c3:/app# bash /start-reload.sh
125-
```
126-
127-
and then hit enter. That runs the live reloading server that auto reloads when it detects code changes.
128-
129-
Nevertheless, if it doesn't detect a change but a syntax error, it will just stop with an error. But as the container is still alive and you are in a Bash session, you can quickly restart it after fixing the error, running the same command ("up arrow" and "Enter").
130-
131-
...this previous detail is what makes it useful to have the container alive doing nothing and then, in a Bash session, make it run the live reload server.
132-
133113
### Backend tests
134114

135115
To test the backend run:

0 commit comments

Comments
 (0)