Skip to content

Commit a719986

Browse files
committed
Update README.md
Added detailled instructions for Docker compose and newly added services
1 parent 692a657 commit a719986

1 file changed

Lines changed: 27 additions & 26 deletions

File tree

‎README.md‎

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -109,39 +109,40 @@ Using Docker, you can have a complete, consistent development environment withou
109109

110110
Note that this takes up a significant amount of space on your machine. Make sure you have at least 5GB free.
111111

112-
#### Included files
112+
#### Included Files
113113

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:
114+
Two files are included for Docker configuration:
115115

116-
* The `Dockerfile` contains instructions to set up the development environment.
116+
- **`Dockerfile`**: Contains instructions for setting up the Docker environment.
117+
- **`docker-compose.yml`**: Defines services for managing the application lifecycle:
118+
- `app`: Keeps the container running indefinitely, useful for debugging or running arbitrary commands.
119+
- `fetch-jar`: Automatically downloads the appropriate Processing.py JAR file for image generation.
120+
- `build-site`: Builds the static site without images.
121+
- `build-all`: Builds the static site including images.
122+
- `serve`: Serves the generated site using Python's built-in HTTP server on port 8080.
117123

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.
124+
#### Setup Instructions
122125

123-
#### Step 1: Setting up
124-
1.Install Docker for your operating system
125-
* [Mac](https://www.docker.com/docker-mac)
126-
* [Windows](https://www.docker.com/docker-windows)
127-
2. Install [Docker Desktop](https://www.docker.com/products/docker-desktop/)
128-
3. Clone this repository and `cd` into it
129-
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.
126+
1. **Install Docker**:
127+
- For Mac: [Docker for Mac](https://www.docker.com/docker-mac)
128+
- For Windows: [Docker for Windows](https://www.docker.com/docker-windows)
129+
- Ensure [Docker Desktop](https://www.docker.com/products/docker-desktop/) is installed and running.
130+
2. **Prepare the Project**:
131+
- Clone this repository and navigate into the project directory.
132+
- Build the Docker image: `docker build -t processing-py-site .`. This command creates a Docker image named `processing-py-site`, based on the `Dockerfile`.
130133

131-
#### Step 2: Building the static site
134+
#### Building the Static Site
132135

133-
To build the static site using Docker Compose, run the following command from the root of your project:
136+
- **Fetch Processing.py JAR** (if needed):
137+
- Run `docker-compose run --rm fetch-jar` to automatically download the correct Processing.py JAR file for your architecture.
138+
- **Build the Site**:
139+
- Execute `docker-compose run --rm build-all` to build the entire site, including images. Use `docker-compose run --rm build-site` to build without images.
140+
- The `--rm` flag ensures the container is removed after completion.
134141

135-
`docker-compose run --rm build`
142+
#### Serving the Site Locally
136143

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.
144+
- Start the server with `docker-compose up serve`. This serves the site on `http://localhost:8080`.
145+
- Access the site via your web browser.
145146

146147
## Troubleshooting
147148

@@ -186,4 +187,4 @@ or could be improved, and if possible how.
186187

187188
## Contributing:
188189

189-
see [CONTRIBUTING.md](CONTRIBUTING.md)
190+
see [CONTRIBUTING.md](CONTRIBUTING.md)

0 commit comments

Comments
 (0)