Foundation
This commit is contained in:
12
app/Dockerfile
Normal file
12
app/Dockerfile
Normal 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
2
app/requirements.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
Flask
|
||||
mysql-connector-python
|
||||
0
app/templates/add_user.html
Normal file
0
app/templates/add_user.html
Normal file
0
app/templates/edit_user.html
Normal file
0
app/templates/edit_user.html
Normal file
0
app/templates/user_list.html
Normal file
0
app/templates/user_list.html
Normal file
31
docker-compose.yml
Normal file
31
docker-compose.yml
Normal 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
3
nginx/Dockerfile
Normal file
@@ -0,0 +1,3 @@
|
||||
FROM nginx:alpine
|
||||
|
||||
COPY nginx.conf /etc/nginx/nginx.conf
|
||||
16
nginx/nginx.conf
Normal file
16
nginx/nginx.conf
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user