Foundation

This commit is contained in:
2025-03-28 08:23:48 -04:00
parent 88b0fa3148
commit d710450697
8 changed files with 64 additions and 0 deletions

12
app/Dockerfile Normal file
View File

@@ -0,0 +1,12 @@
FROM python:3.9-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
EXPOSE 5000
CMD ["python", "app.py"]

2
app/requirements.txt Normal file
View File

@@ -0,0 +1,2 @@
Flask
mysql-connector-python

View File

View File

View File

31
docker-compose.yml Normal file
View File

@@ -0,0 +1,31 @@
version: '3.8'
services:
app:
build:
context: ./app
dockerfile: Dockerfile
volumes:
- ./app:/app
environment:
- FLASK_APP=app.py
- FLASK_ENV=development
depends_on:
- db
nginx:
build:
context: ./nginx
dockerfile: Dockerfile
ports:
- "80:80"
depends_on:
- app
db:
image: mariadb:10.6
environment:
MYSQL_ROOT_PASSWORD: your_root_password
MYSQL_DATABASE: radius
MYSQL_USER: radiususer
MYSQL_PASSWORD: radiuspassword
volumes:
- ./db-data:/var/lib/mysql # persistant data.

3
nginx/Dockerfile Normal file
View File

@@ -0,0 +1,3 @@
FROM nginx:alpine
COPY nginx.conf /etc/nginx/nginx.conf

16
nginx/nginx.conf Normal file
View File

@@ -0,0 +1,16 @@
events {}
http {
server {
listen 80;
server_name localhost;
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;
}
}
}