Skip to content

Commit

Permalink
Merge pull request #7 from Oneloutre/developement
Browse files Browse the repository at this point in the history
Developement
  • Loading branch information
Oneloutre authored Apr 26, 2024
2 parents 3f03d07 + 1aeda19 commit 17a235c
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SECRET_KEY=your_secret_key
PORT=5000
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM python:3.12-alpine as builder

COPY requirements.txt .
RUN python -m pip install --upgrade pip
RUN pip install -r requirements.txt


COPY ./routes /app/routes
COPY ./static /app/static
COPY ./templates /app/templates
COPY ./app.py /app/
COPY ./ /app/
COPY ./requirements.txt /app/
COPY .env /app/

WORKDIR /app

# Exécuter l'application
CMD ["python", "app.py"]
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,15 @@
</div>
<div align='center'>


![Python Badge](https://img.shields.io/badge/Python-3776AB?logo=python&logoColor=fff&style=flat) ![Docker Badge](https://img.shields.io/badge/Docker-2496ED?logo=docker&logoColor=fff&style=flat) ![HTML5 Badge](https://img.shields.io/badge/HTML5-E34F26?logo=html5&logoColor=fff&style=flat) ![CSS3 Badge](https://img.shields.io/badge/CSS3-1572B6?logo=css3&logoColor=fff&style=flat) ![.ENV Badge](https://img.shields.io/badge/.ENV-ECD53F?logo=dotenv&logoColor=000&style=flat)

</div>

<div align='center'>
<h2>This is under very active development ! Expect bugs and unexpected behaviours ! (but feel free to contact me ;) )</h2>
</div>

----

# :notebook_with_decorative_cover: Table of Contents
Expand Down
10 changes: 8 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,19 @@
from datetime import timedelta, datetime, timezone
from jwt.exceptions import ExpiredSignatureError
from routes.misc.add_proxy import *
from dotenv import load_dotenv


dotenv = load_dotenv()
SECRET_KEY = os.getenv('SECRET_KEY')
PORT = os.getenv('PORT')


APP = flask.Flask(__name__)
jwt = JWTManager(APP)

APP.config['JWT_TOKEN_LOCATION'] = ['cookies']
APP.config['JWT_SECRET_KEY'] = 'your-secret-key'
APP.config['JWT_SECRET_KEY'] = SECRET_KEY
APP.config['JWT_ACCESS_TOKEN_EXPIRES'] = timedelta(days=1)


Expand Down Expand Up @@ -98,4 +104,4 @@ def refresh_expiring_jwts(response):

if __name__ == '__main__':
APP.debug = False
APP.run()
APP.run(port=PORT)
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ soupsieve==2.5
urllib3==2.2.1
Werkzeug==3.0.2
WTForms==3.1.2
python-dotenv==1.0.1

0 comments on commit 17a235c

Please sign in to comment.