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/README.md b/README.md index a43853e..617ba3e 100644 --- a/README.md +++ b/README.md @@ -14,3 +14,10 @@ _(I'm not an experienced developer, just a tinkerer)_ --- - Installation : [here](install.md) - Sources : [here](sources.md) + +## Docker Compose +The Docker image has a built in admin account, **PLEASE CHANGE PASSWORD AFTER INITIAL LOG IN** +- Username: admin +- Password: _PleaseChangeMe_ +
+Use docker-compose.yml file to deploy. 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/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..c703c22 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,13 @@ +name: Flask-IPAM +services: + flask-ipam: + image: ghcr.io/cafrays/flask_ipam:v1.2 + container_name: flask-ipam + restart: unless-stopped + ports: + - 5000:5000 + volumes: + - flask-ipam:/fipam/instance + +volumes: + flask-ipam: 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