You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: {{cookiecutter.project_slug}}/README.md
+1-21
Original file line number
Diff line number
Diff line change
@@ -82,9 +82,7 @@ During development, you can change Docker Compose settings that will only affect
82
82
83
83
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.
84
84
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:
88
86
89
87
```console
90
88
$ docker-compose up -d
@@ -112,24 +110,6 @@ root@7f2607af31c3:/app#
112
110
113
111
that means that you are in a `bash` session inside your container, as a `root` user, under the `/app` directory.
114
112
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.
0 commit comments