Convert to Flask and dockerize.

This commit is contained in:
whitney 2024-09-11 10:50:51 -07:00
parent 5480ac5a3a
commit 6192850b33
7 changed files with 46 additions and 0 deletions

14
Dockerfile Normal file
View File

@ -0,0 +1,14 @@
FROM python:3.10-slim
WORKDIR /app
COPY . /app
RUN pip install --no-cache-dir -r requirements.txt
EXPOSE 5000
ENV FLASK_APP=app.py
ENV FLASK_ENV=development
CMD ["flask", "run", "--host=0.0.0.0"]

12
app.py Normal file
View File

@ -0,0 +1,12 @@
from flask import Flask, render_template
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')
if __name__ == '__main__':
app.run(debug=True)

17
docker-compose.yml Normal file
View File

@ -0,0 +1,17 @@
networks:
traefik:
external: true
services:
jakeswestcoast:
container_name: jakeswestcoast
networks:
- traefik
build: .
ports:
- "5000:5000"
labels:
- traefik.http.routers.league.rule=Host(`jakeswestcoast.com`) || Host(`www.jakeswestcoast.com`)
- traefik.http.routers.league.tls=true
- traefik.http.routers.league.tls.certresolver=lets-encrypt
- traefik.http.services.downloads.loadbalancer.server.port=5000

2
requirements.txt Normal file
View File

@ -0,0 +1,2 @@
Flask==3.0.3

View File

@ -3,3 +3,4 @@
* @author Jake Runyan
* @desc Main CSS
*//*************************************************/

View File

Before

Width:  |  Height:  |  Size: 654 KiB

After

Width:  |  Height:  |  Size: 654 KiB