Release v1.5.0: Restructure chapters and update for Docker v30.x

This commit is contained in:
Baohua Yang
2026-02-04 22:12:38 -08:00
parent b4b0d4160a
commit fdb879dcf2
304 changed files with 1314 additions and 364 deletions

View File

@@ -0,0 +1,5 @@
FROM python:3.12-alpine
ADD . /code
WORKDIR /code
RUN pip install redis flask
CMD ["python", "app.py"]

View File

@@ -0,0 +1,13 @@
from flask import Flask
from redis import Redis
app = Flask(__name__)
redis = Redis(host='redis', port=6379)
@app.route('/')
def hello():
count = redis.incr('hits')
return 'Hello World! 该页面已被访问 {} \n'.format(count)
if __name__ == "__main__":
app.run(host="0.0.0.0", debug=True)

View File

@@ -0,0 +1,10 @@
services:
web:
build: .
ports:
- "5000:5000"
redis:
image: "redis:alpine"