first commit

This commit is contained in:
unkas.a@skynet.kz 2024-08-07 10:51:47 +05:00
commit 26f91a08fe
6 changed files with 57 additions and 0 deletions

13
app/Dockerfile Normal file
View File

@ -0,0 +1,13 @@
# Используем образ Python
FROM python:3.9-slim
# Устанавливаем зависимости
WORKDIR /app
COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt
# Копируем исходный код приложения
COPY . .
# Запускаем приложение
CMD ["python", "app.py"]

10
app/app.py Normal file
View File

@ -0,0 +1,10 @@
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello, World!'
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5000)

1
app/requirements.txt Normal file
View File

@ -0,0 +1 @@
flask

14
docker-compose.yml Normal file
View File

@ -0,0 +1,14 @@
version: '3.8'
services:
web:
build: ./web
ports:
- "8080:80"
depends_on:
- app
app:
build: ./app
ports:
- "5000:5000"

5
web/Dockerfile Normal file
View File

@ -0,0 +1,5 @@
# Используем образ Nginx
FROM nginx:alpine
# Копируем конфигурационный файл Nginx
COPY nginx.conf /etc/nginx/nginx.conf

14
web/nginx.conf Normal file
View File

@ -0,0 +1,14 @@
events { }
http {
server {
listen 80;
location / {
proxy_pass http://app:5000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
}