Skip to content

Commit 1c0cda5

Browse files
committed
Add Docker support for local development
--- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/weeklydevchat/weeklydevchat.github.io?shareId=XXXX-XXXX-XXXX-XXXX).
1 parent b832c26 commit 1c0cda5

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed

.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Exclude unnecessary files from the Docker build context
2+
site/
3+
.venv/

Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Use python:3.x-slim as the base image
2+
FROM python:3.x-slim
3+
4+
# Set the working directory to /app
5+
WORKDIR /app
6+
7+
# Copy requirements.txt to the Docker image
8+
COPY requirements.txt .
9+
10+
# Install dependencies
11+
RUN pip install -r requirements.txt
12+
13+
# Copy the rest of the repository to the Docker image
14+
COPY . .
15+
16+
# Expose port 8000
17+
EXPOSE 8000
18+
19+
# Set the default command to serve the MkDocs site
20+
CMD ["mkdocs", "serve", "-a", "0.0.0.0:8000"]

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,19 @@ Requirements:
3232
index.md # The documentation homepage.
3333
posts/ # blog posts, organised anyway you like
3434
... # Other markdown pages, images and other files.
35+
36+
# Docker Guide
37+
38+
To build and run the Docker container locally, follow these steps:
39+
40+
1. Build the Docker image:
41+
```sh
42+
docker build -t weeklydevchat .
43+
```
44+
45+
2. Run the Docker container:
46+
```sh
47+
docker run -p 8000:8000 weeklydevchat
48+
```
49+
50+
The MkDocs site will be served on port 8000.

0 commit comments

Comments
 (0)