From 55aaeae1da48f6e294b383486277f088258464ef Mon Sep 17 00:00:00 2001 From: fdrock Date: Sat, 29 Mar 2025 15:10:17 -0400 Subject: [PATCH] Working on a Docker Container --- Dockerfile | 12 ++++++++++++ app/_config.py | 6 +++--- requirements.txt | 4 +++- setup.py | 0 4 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 Dockerfile mode change 100644 => 100755 setup.py diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1045961 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM python:3.13.2-alpine3.21 +WORKDIR /fipam +COPY requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt +COPY app /fipam/app +COPY instance /fipam/instance +ENV APP_HOME=/fipam +ENV PYTHONPATH=${APP_HOME} +ENV PATH="$PATH:${APP_HOME}/.local/bin" +ENV GUNICORN_CMD_ARGS="--bind=0.0.0.0:5000 --workers=2 --preload" +EXPOSE 5000 +ENTRYPOINT ["gunicorn","app:create_app()"] diff --git a/app/_config.py b/app/_config.py index 23d5935..ba5f397 100644 --- a/app/_config.py +++ b/app/_config.py @@ -10,11 +10,11 @@ app_maintenance = False app_name = 'takeus-ipam' app_version = 'V1.2' app_release_date = '02/2025' -app_url = "http://127.0.0.1" +app_url = "http://0.0.0.0" class Configuration: # openssl rand -hex 32 - SECRET_KEY = 'change_me' + SECRET_KEY = '619b2920234c8c472b2a7121c82a5d62ea86a083dc00e2bc9b09b695f00641ea' # DB CONFIG SQLALCHEMY_DATABASE_URI = 'sqlite:///database.db' SQLALCHEMY_TRACK_MODIFICATIONS = False @@ -22,4 +22,4 @@ class Configuration: # CK CONFIG SESSION_COOKIE_SECURE = False # SSL REQUIRED SESSION_COOKIE_HTTPONLY = True - SESSION_COOKIE_SAMESITE = 'Lax' \ No newline at end of file + SESSION_COOKIE_SAMESITE = 'Lax' diff --git a/requirements.txt b/requirements.txt index d97ddf2..c532233 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,9 @@ +wheel +gunicorn Flask Flask-Login Flask-SQLAlchemy Flask-WTF mysql-connector-python SQLAlchemy -cryptography \ No newline at end of file +cryptography diff --git a/setup.py b/setup.py old mode 100644 new mode 100755