mirror of
https://github.com/TakeusV1/flask_ipam.git
synced 2026-10-13 17:15:33 +02:00
Merge branch 'PROD' into DEV
This commit is contained in:
7 files changed
+43
-3
No files matched your search
+12
@@ -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()"]
|
||||
@@ -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_
|
||||
<br>
|
||||
Use docker-compose.yml file to deploy.
|
||||
+1
-1
@@ -12,7 +12,7 @@ app_maintenance = False
|
||||
app_name = 'takeus-ipam'
|
||||
app_version = 'V1.3'
|
||||
app_release_date = '02/2025'
|
||||
app_url = "http://127.0.0.1"
|
||||
app_url = "http://0.0.0.0"
|
||||
|
||||
class Configuration:
|
||||
# replace SECRET_KEY with value from "openssl rand -hex 32" or similar for STATIC sessions
|
||||
|
||||
@@ -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
@@ -2,10 +2,16 @@
|
||||
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>
|
||||
|
||||
- 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()'`
|
||||
- For any troubleshooting, you can add `--preload` at the end of the command for verbose logging.
|
||||
- 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)_
|
||||
- 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`)_
|
||||
@@ -1,3 +1,5 @@
|
||||
wheel
|
||||
gunicorn
|
||||
Flask
|
||||
Flask-Login
|
||||
Flask-SQLAlchemy
|
||||
|
||||
Reference in new issue
Block a user