Merge branch 'PROD' into DEV

This commit is contained in:
Takeus authored and GitHub committed 2025-04-01 11:55:08 +02:00
commit 969b7dac2f
7 files changed
+43 -3

No files matched your search

+12
View File
@@ -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()"]
+7
View File
@@ -14,3 +14,10 @@ _(I'm not an experienced developer, just a tinkerer)_
--- ---
- Installation : [here](install.md) - Installation : [here](install.md)
- Sources : [here](sources.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_
<br>
Use docker-compose.yml file to deploy.
+1 -1
View File
@@ -12,7 +12,7 @@ app_maintenance = False
app_name = 'takeus-ipam' app_name = 'takeus-ipam'
app_version = 'V1.3' app_version = 'V1.3'
app_release_date = '02/2025' app_release_date = '02/2025'
app_url = "http://127.0.0.1" app_url = "http://0.0.0.0"
class Configuration: class Configuration:
# replace SECRET_KEY with value from "openssl rand -hex 32" or similar for STATIC sessions # replace SECRET_KEY with value from "openssl rand -hex 32" or similar for STATIC sessions
+13
View File
@@ -0,0 +1,13 @@
name: Flask-IPAM
services:
flask-ipam:
image: ghcr.io/cafrays/flask_ipam:latest
container_name: flask-ipam
restart: unless-stopped
ports:
- 5000:5000
volumes:
- flask-ipam:/fipam/instance
volumes:
flask-ipam:
+8 -2
View File
@@ -2,10 +2,16 @@
This documentation is very good, but needs a few changes to make it work (in our case) : This documentation is very good, but needs a few changes to make it work (in our case) :
https://www.digitalocean.com/community/tutorials/how-to-serve-flask-applications-with-gunicorn-and-nginx-on-ubuntu-22-04<br> https://www.digitalocean.com/community/tutorials/how-to-serve-flask-applications-with-gunicorn-and-nginx-on-ubuntu-22-04<br>
- You don't need to create `wsgi.py`, when asked, replace : `wsgi:app` with `'app:create_app()'` . Before starting the app ensure to install pip packages in requirements.txt Referrenced [Section](https://www.digitalocean.com/community/tutorials/how-to-serve-flask-applications-with-gunicorn-and-nginx-on-ubuntu-22-04#step-4-configuring-gunicorn)
- `pip install Flask-Login Flask-SQLAlchemy Flask-WTF mysql-connector-python SQLAlchemy cryptography`
- Update the configuration file under _app/\_config.py_.
- `app_ip = '127.0.0.1'` to `app_ip = '0.0.0.0'` for easy web access.
- Update **SECRET_KEY='CHANGE_ME'** variable, `openssl rand -hex 32` can be used to create a random key.
- You don't need to create or continue with the `wsgi.py` section. When asked, replace: `wsgi:app` with `'app:create_app()'` .
- EX : For starting APP with gunicorn : `gunicorn --bind 0.0.0.0:5000 'app:create_app()'` - EX : For starting APP with gunicorn : `gunicorn --bind 0.0.0.0:5000 'app:create_app()'`
- For any troubleshooting, you can add `--preload` at the end of the command for verbose logging.
- In Service File, replace "ExecStart" line with :<br> - In Service File, replace "ExecStart" line with :<br>
`ExecStart=/YOUR_ENV_LOCATION/bin/gunicorn --workers 1 --bind unix:fipam.sock -m 007 'app:create_app()'`<br> `ExecStart=/YOUR_ENV_LOCATION/bin/gunicorn --workers 1 --bind 0.0.0.0:5000 -m 007 'app:create_app()'`<br>
_(Adjust the number of workers to your needs)_ _(Adjust the number of workers to your needs)_
- you must first run setup.py to create the admin user.<br> - you must first run setup.py to create the admin user.<br>
_(it will create a second database in `./var/setup-instance`. It will have to be merged in the application database in `./var/app-instance`)_ _(it will create a second database in `./var/setup-instance`. It will have to be merged in the application database in `./var/app-instance`)_
+2
View File
@@ -1,3 +1,5 @@
wheel
gunicorn
Flask Flask
Flask-Login Flask-Login
Flask-SQLAlchemy Flask-SQLAlchemy
Regular → Executable
View File
File mode changed.