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
{{ message }}
Repository navigation
Commit be50144
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: README.md
+39Lines changed: 39 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -104,6 +104,45 @@ To test the site in a local server:
104
104
105
105
python generator.py test
106
106
107
+
### Building with Docker
108
+
Using Docker, you can have a complete, consistent development environment without having to manually install dependencies and set up your environment. It also helps isolate these dependencies and their data from other projects that you may have on the same computer that use different/conflicting versions, etc.
109
+
110
+
Note that this takes up a significant amount of space on your machine. Make sure you have at least 5GB free.
111
+
112
+
#### Included files
113
+
114
+
Two files are included that are used by Docker to configure the environment, build, and serve the site. These files are pre-configured, and you typically won't need to edit them:
115
+
116
+
* The `Dockerfile` contains instructions to set up the development environment.
117
+
118
+
* The `docker-compose.yml` file defines three services to manage the application lifecycle:
119
+
*`app`: A base service that keeps the container running indefinitely. It's useful for debugging or running arbitrary commands within the container.
120
+
*`build`: A service that runs the generator.py script to build the static site.
121
+
*`serve`: A service that serves the generated site using Python's built-in HTTP server.
4. Build the Docker Image: `docker build -t processing-py-site .` This command creates a Docker image named processing-py-site, based on the instructions in the `Dockerfile` present in the repository.
130
+
131
+
#### Step 2: Building the static site
132
+
133
+
To build the static site using Docker Compose, run the following command from the root of your project:
134
+
135
+
`docker-compose run --rm build`
136
+
137
+
This command starts a Docker container using the configuration from the `build` service, which executes the `generator.py` script to generate the static site. The `--rm` flag ensures the container is removed after the script finishes.
138
+
139
+
#### Step 3: Serving the Site Locally
140
+
After building the site, you can serve it locally by running:
141
+
142
+
`docker-compose up serve`
143
+
144
+
This command starts a Docker container that serves the generated static site on port 8080, as specified in the `serve` service. You can view the site by navigating to `http://localhost:8080` in a web browser.
145
+
107
146
## Troubleshooting
108
147
109
148
Here are a few common and/or possible scenarios you might run into...
0 commit comments