mirror of
https://github.com/ParisNeo/lollms-webui.git
synced 2024-12-18 20:17:50 +00:00
fix docker
This commit is contained in:
parent
9305887970
commit
aea0c74648
20
Dockerfile
20
Dockerfile
@ -3,16 +3,26 @@ FROM python:3.10
|
|||||||
WORKDIR /srv
|
WORKDIR /srv
|
||||||
COPY ./requirements.txt .
|
COPY ./requirements.txt .
|
||||||
|
|
||||||
RUN python3 -m venv venv && . venv/bin/activate
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
RUN python3 -m pip install --no-cache-dir -r requirements.txt --upgrade pip
|
|
||||||
|
|
||||||
COPY ./app.py /srv/app.py
|
COPY ./app.py /srv/app.py
|
||||||
COPY ./api /srv/api
|
COPY ./api /srv/api
|
||||||
COPY ./static /srv/static
|
COPY ./static /srv/static
|
||||||
COPY ./templates /srv/templates
|
COPY ./templates /srv/templates
|
||||||
COPY ./web /srv/web
|
COPY ./web /srv/web
|
||||||
COPY ./configs /srv/configs
|
|
||||||
COPY ./assets /srv/assets
|
COPY ./assets /srv/assets
|
||||||
|
|
||||||
# COPY ./models /srv/models # Mounting model is more efficient
|
# TODO: this is monkey-patch for check_update() function, should be disabled in Docker
|
||||||
CMD ["python", "app.py", "--host", "0.0.0.0", "--port", "9600", "--db_path", "data/database.db"]
|
COPY ./.git /srv/.git
|
||||||
|
|
||||||
|
VOLUME [ "/data" ]
|
||||||
|
|
||||||
|
# Monkey-patch: send a "enter" keystroke to python to confirm the first launch process
|
||||||
|
CMD ["/bin/bash", "-c", " \
|
||||||
|
echo -ne '\n' | \
|
||||||
|
python app.py \
|
||||||
|
--host 0.0.0.0 \
|
||||||
|
--port 9600 \
|
||||||
|
--db_path /data/Documents/databases/database.db \
|
||||||
|
--config /configs/config.yaml \
|
||||||
|
"]
|
||||||
|
4
app.py
4
app.py
@ -1998,6 +1998,8 @@ if __name__ == "__main__":
|
|||||||
else:
|
else:
|
||||||
print(f"Please open your browser and go to {url} to view the ui")
|
print(f"Please open your browser and go to {url} to view the ui")
|
||||||
|
|
||||||
socketio.run(app, host=config["host"], port=config["port"])
|
socketio.run(app, host=config["host"], port=config["port"],
|
||||||
|
# prevent error: The Werkzeug web server is not designed to run in production
|
||||||
|
allow_unsafe_werkzeug=True)
|
||||||
# http_server = WSGIServer((config["host"], config["port"]), app, handler_class=WebSocketHandler)
|
# http_server = WSGIServer((config["host"], config["port"]), app, handler_class=WebSocketHandler)
|
||||||
# http_server.serve_forever()
|
# http_server.serve_forever()
|
||||||
|
@ -6,10 +6,12 @@ services:
|
|||||||
context: .
|
context: .
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
volumes:
|
volumes:
|
||||||
- ./data:/srv/help
|
- ./data:/data
|
||||||
- ./data:/srv/data
|
|
||||||
- ./data/.parisneo:/root/.parisneo/
|
- ./data/.parisneo:/root/.parisneo/
|
||||||
- ./configs:/srv/configs
|
- ./configs:/srv/configs
|
||||||
- ./web:/srv/web
|
environment:
|
||||||
|
- HOME=/data
|
||||||
|
tty: true
|
||||||
|
stdin_open: true
|
||||||
ports:
|
ports:
|
||||||
- "9600:9600"
|
- "9600:9600"
|
||||||
|
Loading…
Reference in New Issue
Block a user