Add Dockerfile and update README for Docker deployment
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
parent
680779c03d
commit
75119916e8
11
Dockerfile
Normal file
11
Dockerfile
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# Use the official Nginx image as the base image
|
||||||
|
FROM nginx:alpine
|
||||||
|
|
||||||
|
# Copy the local files to the Nginx default directory
|
||||||
|
COPY . /usr/share/nginx/html
|
||||||
|
|
||||||
|
# Expose port 80
|
||||||
|
EXPOSE 80
|
||||||
|
|
||||||
|
# Start Nginx when the container launches
|
||||||
|
CMD ["nginx", "-g", "daemon off;"]
|
||||||
18
README.md
18
README.md
@ -1 +1,17 @@
|
|||||||
just a fun project for my kid, he loves the Conways game of life.
|
# The Game of Life
|
||||||
|
|
||||||
|
This project is a web-based implementation of Conway's Game of Life.
|
||||||
|
|
||||||
|
## How to Run with Docker
|
||||||
|
|
||||||
|
1. Build the Docker image:
|
||||||
|
```bash
|
||||||
|
docker build -t game-of-life .
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Run the container:
|
||||||
|
```bash
|
||||||
|
docker run -d -p 8080:80 game-of-life
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Open your browser and go to `http://localhost:8080` to see the Game of Life in action.
|
||||||
Loading…
Reference in New Issue
Block a user