From 7231349e96f967b1c059c93aa0de6856f6708486 Mon Sep 17 00:00:00 2001 From: Beesquit Date: Thu, 13 Nov 2025 22:46:11 +0300 Subject: [PATCH] Initial commit --- .gitignore | 4 ++++ README.md | 0 nginx-python/.dockerignore | 12 ++++++++++++ nginx-python/README.md | 1 + nginx-python/compose.yml | 6 ++++++ nginx-python/dockerfile | 8 ++++++++ nginx-python/src/main.py | 32 ++++++++++++++++++++++++++++++++ 7 files changed, 63 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 nginx-python/.dockerignore create mode 100644 nginx-python/README.md create mode 100644 nginx-python/compose.yml create mode 100644 nginx-python/dockerfile create mode 100644 nginx-python/src/main.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..58b70e5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +.venv +__pycache__ +.env + diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/nginx-python/.dockerignore b/nginx-python/.dockerignore new file mode 100644 index 0000000..00bf965 --- /dev/null +++ b/nginx-python/.dockerignore @@ -0,0 +1,12 @@ +#.dockerignore +# Docker +.dockerignore +dockerfile +compose.yaml +compose.yml + +# Git +.gitignore +*.md +example.env + diff --git a/nginx-python/README.md b/nginx-python/README.md new file mode 100644 index 0000000..5595259 --- /dev/null +++ b/nginx-python/README.md @@ -0,0 +1 @@ +todo README.md diff --git a/nginx-python/compose.yml b/nginx-python/compose.yml new file mode 100644 index 0000000..b9735b0 --- /dev/null +++ b/nginx-python/compose.yml @@ -0,0 +1,6 @@ +services: + meow: + image: image:latest + container_name: somename4test + restart: unless-stopped + diff --git a/nginx-python/dockerfile b/nginx-python/dockerfile new file mode 100644 index 0000000..aaf0d8f --- /dev/null +++ b/nginx-python/dockerfile @@ -0,0 +1,8 @@ +FROM python:3.13-slim + +WORKDIR /app + +COPY . . + +CMD ["python", "src/main.py"] + diff --git a/nginx-python/src/main.py b/nginx-python/src/main.py new file mode 100644 index 0000000..9a82fd2 --- /dev/null +++ b/nginx-python/src/main.py @@ -0,0 +1,32 @@ +from http.server import BaseHTTPRequestHandler, HTTPServer + + +class MyHandler(BaseHTTPRequestHandler): + def do_GET(self): + self.send_response(200) + self.send_header('Content-type', 'text/html') + self.end_headers() + html_content = """ + + + + Meow + + +

I'm cat so meow

+

The current time is: {}

+ + + """.format(self.date_time_string()) + self.wfile.write(html_content.encode('utf-8')) + + +def run(server_class=HTTPServer, handler_class=MyHandler, port=4422): + server_address = ('', port) + httpd = server_class(server_address, handler_class) + print(f'Starting httpd server on port {port}...') + httpd.serve_forever() + + +if __name__ == '__main__': + run()