diff --git a/.github/workflows/epicmorg.ecosysctem.freegpt.images.yml b/.github/workflows/epicmorg.ecosysctem.freegpt.images.yml index bc319a11b..361c1c59f 100644 --- a/.github/workflows/epicmorg.ecosysctem.freegpt.images.yml +++ b/.github/workflows/epicmorg.ecosysctem.freegpt.images.yml @@ -24,45 +24,28 @@ jobs: run: make - name: Build and Deploy freegpt-webui 1.0 - run: cd linux/ecosystem/freegpt-webui/chat/1.0 && make build && make deploy + run: cd linux/ecosystem/freegpt-webui/1.0 && make build && make deploy - name: Build and Deploy freegpt-webui 1.1 - run: cd linux/ecosystem/freegpt-webui/chat/1.1 && make build && make deploy + run: cd linux/ecosystem/freegpt-webui/1.1 && make build && make deploy - name: Build and Deploy freegpt-webui 1.2 - run: cd linux/ecosystem/freegpt-webui/chat/1.2 && make build && make deploy + run: cd linux/ecosystem/freegpt-webui/1.2 && make build && make deploy - name: Build and Deploy freegpt-webui 1.3 - run: cd linux/ecosystem/freegpt-webui/chat/1.3 && make build && make deploy + run: cd linux/ecosystem/freegpt-webui/1.3 && make build && make deploy - name: Build and Deploy freegpt-webui 1.3.1 - run: cd linux/ecosystem/freegpt-webui/chat/1.3.1 && make build && make deploy + run: cd linux/ecosystem/freegpt-webui/1.3.1 && make build && make deploy - name: Build and Deploy freegpt-webui 1.3.2 - run: cd linux/ecosystem/freegpt-webui/chat/1.3.2 && make build && make deploy + run: cd linux/ecosystem/freegpt-webui/1.3.2 && make build && make deploy - name: Build and Deploy freegpt-webui 1.4 - run: cd linux/ecosystem/freegpt-webui/chat/1.4 && make build && make deploy + run: cd linux/ecosystem/freegpt-webui/1.4 && make build && make deploy - name: Build and Deploy freegpt-webui latest - run: cd linux/ecosystem/freegpt-webui/chat/latest && make build && make deploy - -################################################################################## - - - name: Build and Deploy freegpt-webui endpoint 1.3 - run: cd linux/ecosystem/freegpt-webui/endpoint/1.3 && make build && make deploy - - - name: Build and Deploy freegpt-webui endpoint 1.3.1 - run: cd linux/ecosystem/freegpt-webui/endpoint/1.3.1 && make build && make deploy - - - name: Build and Deploy freegpt-webui endpoint 1.3.2 - run: cd linux/ecosystem/freegpt-webui/endpoint/1.3.2 && make build && make deploy - - - name: Build and Deploy freegpt-webui endpoint 1.4 - run: cd linux/ecosystem/freegpt-webui/endpoint/1.4 && make build && make deploy - - - name: Build and Deploy freegpt-webui endpoint latest - run: cd linux/ecosystem/freegpt-webui/endpoint/latest && make build && make deploy + run: cd linux/ecosystem/freegpt-webui/latest && make build && make deploy ################################################################################## - name: Cleanup diff --git a/Makefile b/Makefile index 5b1e129f0..932d9b12a 100644 --- a/Makefile +++ b/Makefile @@ -403,21 +403,14 @@ ecosystem-nodejs-images: cd `pwd`/linux/ecosystem/nodejs/node20 && pwd && make build && make deploy ecosystem-freegpt-webui-images: - cd `pwd`/linux/ecosystem/freegpt-webui/chat/1.0 && pwd && make build && make deploy - cd `pwd`/linux/ecosystem/freegpt-webui/chat/1.1 && pwd && make build && make deploy - cd `pwd`/linux/ecosystem/freegpt-webui/chat/1.2 && pwd && make build && make deploy - cd `pwd`/linux/ecosystem/freegpt-webui/chat/1.3 && pwd && make build && make deploy - cd `pwd`/linux/ecosystem/freegpt-webui/chat/1.3.1 && pwd && make build && make deploy - cd `pwd`/linux/ecosystem/freegpt-webui/chat/1.3.2 && pwd && make build && make deploy - cd `pwd`/linux/ecosystem/freegpt-webui/chat/1.4 && pwd && make build && make deploy - cd `pwd`/linux/ecosystem/freegpt-webui/chat/latest && pwd && make build && make deploy - - cd `pwd`/linux/ecosystem/freegpt-webui/endpoint/1.3 && pwd && make build && make deploy - cd `pwd`/linux/ecosystem/freegpt-webui/endpoint/1.3.1 && pwd && make build && make deploy - cd `pwd`/linux/ecosystem/freegpt-webui/endpoint/1.3.2 && pwd && make build && make deploy - cd `pwd`/linux/ecosystem/freegpt-webui/endpoint/1.4 && pwd && make build && make deploy - cd `pwd`/linux/ecosystem/freegpt-webui/endpoint/latest && pwd && make build && make deploy - + cd `pwd`/linux/ecosystem/freegpt-webui/1.0 && pwd && make build && make deploy + cd `pwd`/linux/ecosystem/freegpt-webui/1.1 && pwd && make build && make deploy + cd `pwd`/linux/ecosystem/freegpt-webui/1.2 && pwd && make build && make deploy + cd `pwd`/linux/ecosystem/freegpt-webui/1.3 && pwd && make build && make deploy + cd `pwd`/linux/ecosystem/freegpt-webui/1.3.1 && pwd && make build && make deploy + cd `pwd`/linux/ecosystem/freegpt-webui/1.3.2 && pwd && make build && make deploy + cd `pwd`/linux/ecosystem/freegpt-webui/1.4 && pwd && make build && make deploy + cd `pwd`/linux/ecosystem/freegpt-webui/latest && pwd && make build && make deploy ecosystem-vk2discord-images: cd `pwd`/linux/ecosystem/vk2discord && pwd && make build && make deploy diff --git a/linux/ecosystem/freegpt-webui/chat/1.0/Dockerfile b/linux/ecosystem/freegpt-webui/1.0/Dockerfile similarity index 78% rename from linux/ecosystem/freegpt-webui/chat/1.0/Dockerfile rename to linux/ecosystem/freegpt-webui/1.0/Dockerfile index c7539881c..68e33104a 100644 --- a/linux/ecosystem/freegpt-webui/chat/1.0/Dockerfile +++ b/linux/ecosystem/freegpt-webui/1.0/Dockerfile @@ -11,8 +11,6 @@ ARG FREEGPT_VERSION=1.0 ENV FREEGPT_PATH=/app ENV FREEGPT_PORT=1338 -ENV FREEGTP_PY_BIN=/root/.local/bin -ENV PATH=/root/.local/bin:$PATH RUN git clone --depth 1 --branch ${FREEGPT_VERSION} https://github.com/Em1tSan/freegpt-webui-ru.git ${FREEGPT_PATH} && \ rm -rfv ${FREEGPT_PATH}/.git @@ -24,6 +22,8 @@ RUN apt-get update && \ libcurl4-openssl-dev && \ pip3 install --user --no-cache-dir -r ${FREEGPT_PATH}/requirements.txt +RUN find ${FREEGPT_PATH} -type f -exec dos2unix -k -s -o {} ';' + ################################################################## ################################################################## ################################################################## @@ -35,16 +35,23 @@ FROM epicmorg/python:3.10 AS production ENV FREEGPT_PATH=/app ENV FREEGPT_PORT=1338 -ENV FREEGTP_PY_BIN=/root/.local/bin -ENV PATH=/root/.local/bin:$PATH -RUN mkdir -p ${FREEGTP_PY_BIN} ${FREEGPT_PATH} +RUN mkdir -p ${FREEGPT_PATH} + +################################################################## +# Setup supervisord +################################################################## +RUN apt-get update && \ + apt-get install -y \ + supervisor + +COPY etc/supervisor/conf.d/freegpt.conf /etc/supervisor/conf.d/freegpt.conf ################################################################## # Copy bins ################################################################## -COPY --from=build /root/.local /root/.local -COPY --from=build /app /app +COPY --from=build /root/.local /usr/local +COPY --from=build /app ${FREEGPT_PATH} ################################################################## # cleaninig up @@ -59,4 +66,4 @@ RUN apt clean -y && \ WORKDIR ${FREEGPT_PATH} EXPOSE ${FREEGPT_PORT} -CMD ["python3", "./run.py"] +CMD ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisor/conf.d/freegpt.conf"] diff --git a/linux/ecosystem/freegpt-webui/chat/1.0/Makefile b/linux/ecosystem/freegpt-webui/1.0/Makefile similarity index 100% rename from linux/ecosystem/freegpt-webui/chat/1.0/Makefile rename to linux/ecosystem/freegpt-webui/1.0/Makefile diff --git a/linux/ecosystem/freegpt-webui/chat/1.0/docker-compose.yml b/linux/ecosystem/freegpt-webui/1.0/docker-compose.yml similarity index 100% rename from linux/ecosystem/freegpt-webui/chat/1.0/docker-compose.yml rename to linux/ecosystem/freegpt-webui/1.0/docker-compose.yml diff --git a/linux/ecosystem/freegpt-webui/1.0/etc/supervisor/conf.d/freegpt.conf b/linux/ecosystem/freegpt-webui/1.0/etc/supervisor/conf.d/freegpt.conf new file mode 100644 index 000000000..12c61762f --- /dev/null +++ b/linux/ecosystem/freegpt-webui/1.0/etc/supervisor/conf.d/freegpt.conf @@ -0,0 +1,29 @@ +[unix_http_server] +file=/var/run/supervisor.sock ; (the path to the socket file) +chmod=0700 ; sockef file mode (default 0700) +username = freegpt +password = freegpt + +[supervisord] +logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log) +pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid) +childlogdir=/var/log/supervisor ; ('AUTO' child log dir, default $TEMP) +nodaemon=true +user=root + +[rpcinterface:supervisor] +supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface + +[supervisorctl] +serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL for a unix socket +username = freegpt +password = freegpt + +[program:freegpt-webui] +command=/usr/local/bin/python3.10 /app/run.py +directory=/app +user=root +autostart=true +autorestart=unexpected +priority=666 +startsecs=5 diff --git a/linux/ecosystem/freegpt-webui/chat/1.1/Dockerfile b/linux/ecosystem/freegpt-webui/1.1/Dockerfile similarity index 78% rename from linux/ecosystem/freegpt-webui/chat/1.1/Dockerfile rename to linux/ecosystem/freegpt-webui/1.1/Dockerfile index d874b8024..62e956254 100644 --- a/linux/ecosystem/freegpt-webui/chat/1.1/Dockerfile +++ b/linux/ecosystem/freegpt-webui/1.1/Dockerfile @@ -11,8 +11,6 @@ ARG FREEGPT_VERSION=1.1 ENV FREEGPT_PATH=/app ENV FREEGPT_PORT=1338 -ENV FREEGTP_PY_BIN=/root/.local/bin -ENV PATH=/root/.local/bin:$PATH RUN git clone --depth 1 --branch ${FREEGPT_VERSION} https://github.com/Em1tSan/freegpt-webui-ru.git ${FREEGPT_PATH} && \ rm -rfv ${FREEGPT_PATH}/.git @@ -24,6 +22,8 @@ RUN apt-get update && \ libcurl4-openssl-dev && \ pip3 install --user --no-cache-dir -r ${FREEGPT_PATH}/requirements.txt +RUN find ${FREEGPT_PATH} -type f -exec dos2unix -k -s -o {} ';' + ################################################################## ################################################################## ################################################################## @@ -35,16 +35,23 @@ FROM epicmorg/python:3.10 AS production ENV FREEGPT_PATH=/app ENV FREEGPT_PORT=1338 -ENV FREEGTP_PY_BIN=/root/.local/bin -ENV PATH=/root/.local/bin:$PATH -RUN mkdir -p ${FREEGTP_PY_BIN} ${FREEGPT_PATH} +RUN mkdir -p ${FREEGPT_PATH} + +################################################################## +# Setup supervisord +################################################################## +RUN apt-get update && \ + apt-get install -y \ + supervisor + +COPY etc/supervisor/conf.d/freegpt.conf /etc/supervisor/conf.d/freegpt.conf ################################################################## # Copy bins ################################################################## -COPY --from=build /root/.local /root/.local -COPY --from=build /app /app +COPY --from=build /root/.local /usr/local +COPY --from=build /app ${FREEGPT_PATH} ################################################################## # cleaninig up @@ -59,4 +66,4 @@ RUN apt clean -y && \ WORKDIR ${FREEGPT_PATH} EXPOSE ${FREEGPT_PORT} -CMD ["python3", "./run.py"] +CMD ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisor/conf.d/freegpt.conf"] diff --git a/linux/ecosystem/freegpt-webui/chat/1.1/Makefile b/linux/ecosystem/freegpt-webui/1.1/Makefile similarity index 100% rename from linux/ecosystem/freegpt-webui/chat/1.1/Makefile rename to linux/ecosystem/freegpt-webui/1.1/Makefile diff --git a/linux/ecosystem/freegpt-webui/chat/1.1/docker-compose.yml b/linux/ecosystem/freegpt-webui/1.1/docker-compose.yml similarity index 100% rename from linux/ecosystem/freegpt-webui/chat/1.1/docker-compose.yml rename to linux/ecosystem/freegpt-webui/1.1/docker-compose.yml diff --git a/linux/ecosystem/freegpt-webui/1.1/etc/supervisor/conf.d/freegpt.conf b/linux/ecosystem/freegpt-webui/1.1/etc/supervisor/conf.d/freegpt.conf new file mode 100644 index 000000000..12c61762f --- /dev/null +++ b/linux/ecosystem/freegpt-webui/1.1/etc/supervisor/conf.d/freegpt.conf @@ -0,0 +1,29 @@ +[unix_http_server] +file=/var/run/supervisor.sock ; (the path to the socket file) +chmod=0700 ; sockef file mode (default 0700) +username = freegpt +password = freegpt + +[supervisord] +logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log) +pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid) +childlogdir=/var/log/supervisor ; ('AUTO' child log dir, default $TEMP) +nodaemon=true +user=root + +[rpcinterface:supervisor] +supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface + +[supervisorctl] +serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL for a unix socket +username = freegpt +password = freegpt + +[program:freegpt-webui] +command=/usr/local/bin/python3.10 /app/run.py +directory=/app +user=root +autostart=true +autorestart=unexpected +priority=666 +startsecs=5 diff --git a/linux/ecosystem/freegpt-webui/chat/1.2/Dockerfile b/linux/ecosystem/freegpt-webui/1.2/Dockerfile similarity index 78% rename from linux/ecosystem/freegpt-webui/chat/1.2/Dockerfile rename to linux/ecosystem/freegpt-webui/1.2/Dockerfile index d15694d08..ebcb06a05 100644 --- a/linux/ecosystem/freegpt-webui/chat/1.2/Dockerfile +++ b/linux/ecosystem/freegpt-webui/1.2/Dockerfile @@ -11,8 +11,6 @@ ARG FREEGPT_VERSION=1.2 ENV FREEGPT_PATH=/app ENV FREEGPT_PORT=1338 -ENV FREEGTP_PY_BIN=/root/.local/bin -ENV PATH=/root/.local/bin:$PATH RUN git clone --depth 1 --branch ${FREEGPT_VERSION} https://github.com/Em1tSan/freegpt-webui-ru.git ${FREEGPT_PATH} && \ rm -rfv ${FREEGPT_PATH}/.git @@ -24,6 +22,8 @@ RUN apt-get update && \ libcurl4-openssl-dev && \ pip3 install --user --no-cache-dir -r ${FREEGPT_PATH}/requirements.txt +RUN find ${FREEGPT_PATH} -type f -exec dos2unix -k -s -o {} ';' + ################################################################## ################################################################## ################################################################## @@ -35,16 +35,23 @@ FROM epicmorg/python:3.10 AS production ENV FREEGPT_PATH=/app ENV FREEGPT_PORT=1338 -ENV FREEGTP_PY_BIN=/root/.local/bin -ENV PATH=/root/.local/bin:$PATH -RUN mkdir -p ${FREEGTP_PY_BIN} ${FREEGPT_PATH} +RUN mkdir -p ${FREEGPT_PATH} + +################################################################## +# Setup supervisord +################################################################## +RUN apt-get update && \ + apt-get install -y \ + supervisor + +COPY etc/supervisor/conf.d/freegpt.conf /etc/supervisor/conf.d/freegpt.conf ################################################################## # Copy bins ################################################################## -COPY --from=build /root/.local /root/.local -COPY --from=build /app /app +COPY --from=build /root/.local /usr/local +COPY --from=build /app ${FREEGPT_PATH} ################################################################## # cleaninig up @@ -59,4 +66,4 @@ RUN apt clean -y && \ WORKDIR ${FREEGPT_PATH} EXPOSE ${FREEGPT_PORT} -CMD ["python3", "./run.py"] +CMD ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisor/conf.d/freegpt.conf"] diff --git a/linux/ecosystem/freegpt-webui/chat/1.2/Makefile b/linux/ecosystem/freegpt-webui/1.2/Makefile similarity index 100% rename from linux/ecosystem/freegpt-webui/chat/1.2/Makefile rename to linux/ecosystem/freegpt-webui/1.2/Makefile diff --git a/linux/ecosystem/freegpt-webui/chat/1.2/docker-compose.yml b/linux/ecosystem/freegpt-webui/1.2/docker-compose.yml similarity index 100% rename from linux/ecosystem/freegpt-webui/chat/1.2/docker-compose.yml rename to linux/ecosystem/freegpt-webui/1.2/docker-compose.yml diff --git a/linux/ecosystem/freegpt-webui/1.2/etc/supervisor/conf.d/freegpt.conf b/linux/ecosystem/freegpt-webui/1.2/etc/supervisor/conf.d/freegpt.conf new file mode 100644 index 000000000..12c61762f --- /dev/null +++ b/linux/ecosystem/freegpt-webui/1.2/etc/supervisor/conf.d/freegpt.conf @@ -0,0 +1,29 @@ +[unix_http_server] +file=/var/run/supervisor.sock ; (the path to the socket file) +chmod=0700 ; sockef file mode (default 0700) +username = freegpt +password = freegpt + +[supervisord] +logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log) +pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid) +childlogdir=/var/log/supervisor ; ('AUTO' child log dir, default $TEMP) +nodaemon=true +user=root + +[rpcinterface:supervisor] +supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface + +[supervisorctl] +serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL for a unix socket +username = freegpt +password = freegpt + +[program:freegpt-webui] +command=/usr/local/bin/python3.10 /app/run.py +directory=/app +user=root +autostart=true +autorestart=unexpected +priority=666 +startsecs=5 diff --git a/linux/ecosystem/freegpt-webui/chat/1.3.1/Dockerfile b/linux/ecosystem/freegpt-webui/1.3.1/Dockerfile similarity index 74% rename from linux/ecosystem/freegpt-webui/chat/1.3.1/Dockerfile rename to linux/ecosystem/freegpt-webui/1.3.1/Dockerfile index 99bd9479a..8021c632a 100644 --- a/linux/ecosystem/freegpt-webui/chat/1.3.1/Dockerfile +++ b/linux/ecosystem/freegpt-webui/1.3.1/Dockerfile @@ -11,8 +11,7 @@ ARG FREEGPT_VERSION=1.3.1 ENV FREEGPT_PATH=/app ENV FREEGPT_PORT=1338 -ENV FREEGTP_PY_BIN=/root/.local/bin -ENV PATH=/root/.local/bin:$PATH +ENV FREEGPT_ENDPOINT_PORT=1337 RUN git clone --depth 1 --branch ${FREEGPT_VERSION} https://github.com/Em1tSan/freegpt-webui-ru.git ${FREEGPT_PATH} && \ rm -rfv ${FREEGPT_PATH}/.git @@ -24,6 +23,8 @@ RUN apt-get update && \ libcurl4-openssl-dev && \ pip3 install --user --no-cache-dir -r ${FREEGPT_PATH}/requirements.txt +RUN find ${FREEGPT_PATH} -type f -exec dos2unix -k -s -o {} ';' + ################################################################## ################################################################## ################################################################## @@ -35,16 +36,24 @@ FROM epicmorg/python:3.10 AS production ENV FREEGPT_PATH=/app ENV FREEGPT_PORT=1338 -ENV FREEGTP_PY_BIN=/root/.local/bin -ENV PATH=/root/.local/bin:$PATH +ENV FREEGPT_ENDPOINT_PORT=1337 -RUN mkdir -p ${FREEGTP_PY_BIN} ${FREEGPT_PATH} +RUN mkdir -p ${FREEGPT_PATH} + +################################################################## +# Setup supervisord +################################################################## +RUN apt-get update && \ + apt-get install -y \ + supervisor + +COPY etc/supervisor/conf.d/freegpt.conf /etc/supervisor/conf.d/freegpt.conf ################################################################## # Copy bins ################################################################## -COPY --from=build /root/.local /root/.local -COPY --from=build /app /app +COPY --from=build /root/.local /usr/local +COPY --from=build /app ${FREEGPT_PATH} ################################################################## # cleaninig up @@ -57,6 +66,6 @@ RUN apt clean -y && \ rm -rfv /tmp/* WORKDIR ${FREEGPT_PATH} -EXPOSE ${FREEGPT_PORT} +EXPOSE ${FREEGPT_PORT} ${FREEGPT_ENDPOINT_PORT} -CMD ["python3", "./run.py"] +CMD ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisor/conf.d/freegpt.conf"] diff --git a/linux/ecosystem/freegpt-webui/chat/1.3.1/Makefile b/linux/ecosystem/freegpt-webui/1.3.1/Makefile similarity index 100% rename from linux/ecosystem/freegpt-webui/chat/1.3.1/Makefile rename to linux/ecosystem/freegpt-webui/1.3.1/Makefile diff --git a/linux/ecosystem/freegpt-webui/chat/1.3.1/docker-compose.yml b/linux/ecosystem/freegpt-webui/1.3.1/docker-compose.yml similarity index 100% rename from linux/ecosystem/freegpt-webui/chat/1.3.1/docker-compose.yml rename to linux/ecosystem/freegpt-webui/1.3.1/docker-compose.yml diff --git a/linux/ecosystem/freegpt-webui/1.3.1/etc/supervisor/conf.d/freegpt.conf b/linux/ecosystem/freegpt-webui/1.3.1/etc/supervisor/conf.d/freegpt.conf new file mode 100644 index 000000000..e332d2acd --- /dev/null +++ b/linux/ecosystem/freegpt-webui/1.3.1/etc/supervisor/conf.d/freegpt.conf @@ -0,0 +1,38 @@ +[unix_http_server] +file=/var/run/supervisor.sock ; (the path to the socket file) +chmod=0700 ; sockef file mode (default 0700) +username = freegpt +password = freegpt + +[supervisord] +logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log) +pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid) +childlogdir=/var/log/supervisor ; ('AUTO' child log dir, default $TEMP) +nodaemon=true +user=root + +[rpcinterface:supervisor] +supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface + +[supervisorctl] +serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL for a unix socket +username = freegpt +password = freegpt + +[program:freegpt-webui] +command=/usr/local/bin/python3.10 /app/run.py +directory=/app +user=root +autostart=true +autorestart=unexpected +priority=666 +startsecs=5 + +[program:freegpt-endpoint] +command=/usr/local/bin/python3.10 /app/endpoint.py +directory=/app +user=root +autostart=true +autorestart=unexpected +priority=777 +startsecs=7 diff --git a/linux/ecosystem/freegpt-webui/chat/1.3.2/Dockerfile b/linux/ecosystem/freegpt-webui/1.3.2/Dockerfile similarity index 74% rename from linux/ecosystem/freegpt-webui/chat/1.3.2/Dockerfile rename to linux/ecosystem/freegpt-webui/1.3.2/Dockerfile index ba7c9c60b..5e67b687c 100644 --- a/linux/ecosystem/freegpt-webui/chat/1.3.2/Dockerfile +++ b/linux/ecosystem/freegpt-webui/1.3.2/Dockerfile @@ -11,8 +11,7 @@ ARG FREEGPT_VERSION=1.3.2 ENV FREEGPT_PATH=/app ENV FREEGPT_PORT=1338 -ENV FREEGTP_PY_BIN=/root/.local/bin -ENV PATH=/root/.local/bin:$PATH +ENV FREEGPT_ENDPOINT_PORT=1337 RUN git clone --depth 1 --branch ${FREEGPT_VERSION} https://github.com/Em1tSan/freegpt-webui-ru.git ${FREEGPT_PATH} && \ rm -rfv ${FREEGPT_PATH}/.git @@ -24,6 +23,8 @@ RUN apt-get update && \ libcurl4-openssl-dev && \ pip3 install --user --no-cache-dir -r ${FREEGPT_PATH}/requirements-docker.txt +RUN find ${FREEGPT_PATH} -type f -exec dos2unix -k -s -o {} ';' + ################################################################## ################################################################## ################################################################## @@ -35,16 +36,24 @@ FROM epicmorg/python:3.10 AS production ENV FREEGPT_PATH=/app ENV FREEGPT_PORT=1338 -ENV FREEGTP_PY_BIN=/root/.local/bin -ENV PATH=/root/.local/bin:$PATH +ENV FREEGPT_ENDPOINT_PORT=1337 -RUN mkdir -p ${FREEGTP_PY_BIN} ${FREEGPT_PATH} +RUN mkdir -p ${FREEGPT_PATH} + +################################################################## +# Setup supervisord +################################################################## +RUN apt-get update && \ + apt-get install -y \ + supervisor + +COPY etc/supervisor/conf.d/freegpt.conf /etc/supervisor/conf.d/freegpt.conf ################################################################## # Copy bins ################################################################## -COPY --from=build /root/.local /root/.local -COPY --from=build /app /app +COPY --from=build /root/.local /usr/local +COPY --from=build /app ${FREEGPT_PATH} ################################################################## # cleaninig up @@ -57,6 +66,6 @@ RUN apt clean -y && \ rm -rfv /tmp/* WORKDIR ${FREEGPT_PATH} -EXPOSE ${FREEGPT_PORT} +EXPOSE ${FREEGPT_PORT} ${FREEGPT_ENDPOINT_PORT} -CMD ["python3", "./run.py"] +CMD ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisor/conf.d/freegpt.conf"] diff --git a/linux/ecosystem/freegpt-webui/chat/1.3.2/Makefile b/linux/ecosystem/freegpt-webui/1.3.2/Makefile similarity index 100% rename from linux/ecosystem/freegpt-webui/chat/1.3.2/Makefile rename to linux/ecosystem/freegpt-webui/1.3.2/Makefile diff --git a/linux/ecosystem/freegpt-webui/chat/1.3.2/docker-compose.yml b/linux/ecosystem/freegpt-webui/1.3.2/docker-compose.yml similarity index 100% rename from linux/ecosystem/freegpt-webui/chat/1.3.2/docker-compose.yml rename to linux/ecosystem/freegpt-webui/1.3.2/docker-compose.yml diff --git a/linux/ecosystem/freegpt-webui/1.3.2/etc/supervisor/conf.d/freegpt.conf b/linux/ecosystem/freegpt-webui/1.3.2/etc/supervisor/conf.d/freegpt.conf new file mode 100644 index 000000000..e332d2acd --- /dev/null +++ b/linux/ecosystem/freegpt-webui/1.3.2/etc/supervisor/conf.d/freegpt.conf @@ -0,0 +1,38 @@ +[unix_http_server] +file=/var/run/supervisor.sock ; (the path to the socket file) +chmod=0700 ; sockef file mode (default 0700) +username = freegpt +password = freegpt + +[supervisord] +logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log) +pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid) +childlogdir=/var/log/supervisor ; ('AUTO' child log dir, default $TEMP) +nodaemon=true +user=root + +[rpcinterface:supervisor] +supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface + +[supervisorctl] +serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL for a unix socket +username = freegpt +password = freegpt + +[program:freegpt-webui] +command=/usr/local/bin/python3.10 /app/run.py +directory=/app +user=root +autostart=true +autorestart=unexpected +priority=666 +startsecs=5 + +[program:freegpt-endpoint] +command=/usr/local/bin/python3.10 /app/endpoint.py +directory=/app +user=root +autostart=true +autorestart=unexpected +priority=777 +startsecs=7 diff --git a/linux/ecosystem/freegpt-webui/chat/1.3/Dockerfile b/linux/ecosystem/freegpt-webui/1.3/Dockerfile similarity index 74% rename from linux/ecosystem/freegpt-webui/chat/1.3/Dockerfile rename to linux/ecosystem/freegpt-webui/1.3/Dockerfile index 14862ca06..5be9442dc 100644 --- a/linux/ecosystem/freegpt-webui/chat/1.3/Dockerfile +++ b/linux/ecosystem/freegpt-webui/1.3/Dockerfile @@ -11,8 +11,7 @@ ARG FREEGPT_VERSION=1.3 ENV FREEGPT_PATH=/app ENV FREEGPT_PORT=1338 -ENV FREEGTP_PY_BIN=/root/.local/bin -ENV PATH=/root/.local/bin:$PATH +ENV FREEGPT_ENDPOINT_PORT=1337 RUN git clone --depth 1 --branch ${FREEGPT_VERSION} https://github.com/Em1tSan/freegpt-webui-ru.git ${FREEGPT_PATH} && \ rm -rfv ${FREEGPT_PATH}/.git @@ -24,6 +23,8 @@ RUN apt-get update && \ libcurl4-openssl-dev && \ pip3 install --user --no-cache-dir -r ${FREEGPT_PATH}/requirements.txt +RUN find ${FREEGPT_PATH} -type f -exec dos2unix -k -s -o {} ';' + ################################################################## ################################################################## ################################################################## @@ -35,16 +36,24 @@ FROM epicmorg/python:3.10 AS production ENV FREEGPT_PATH=/app ENV FREEGPT_PORT=1338 -ENV FREEGTP_PY_BIN=/root/.local/bin -ENV PATH=/root/.local/bin:$PATH +ENV FREEGPT_ENDPOINT_PORT=1337 -RUN mkdir -p ${FREEGTP_PY_BIN} ${FREEGPT_PATH} +RUN mkdir -p ${FREEGPT_PATH} + +################################################################## +# Setup supervisord +################################################################## +RUN apt-get update && \ + apt-get install -y \ + supervisor + +COPY etc/supervisor/conf.d/freegpt.conf /etc/supervisor/conf.d/freegpt.conf ################################################################## # Copy bins ################################################################## -COPY --from=build /root/.local /root/.local -COPY --from=build /app /app +COPY --from=build /root/.local /usr/local +COPY --from=build /app ${FREEGPT_PATH} ################################################################## # cleaninig up @@ -57,6 +66,6 @@ RUN apt clean -y && \ rm -rfv /tmp/* WORKDIR ${FREEGPT_PATH} -EXPOSE ${FREEGPT_PORT} +EXPOSE ${FREEGPT_PORT} ${FREEGPT_ENDPOINT_PORT} -CMD ["python3", "./run.py"] +CMD ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisor/conf.d/freegpt.conf"] diff --git a/linux/ecosystem/freegpt-webui/chat/1.3/Makefile b/linux/ecosystem/freegpt-webui/1.3/Makefile similarity index 100% rename from linux/ecosystem/freegpt-webui/chat/1.3/Makefile rename to linux/ecosystem/freegpt-webui/1.3/Makefile diff --git a/linux/ecosystem/freegpt-webui/chat/1.3/docker-compose.yml b/linux/ecosystem/freegpt-webui/1.3/docker-compose.yml similarity index 100% rename from linux/ecosystem/freegpt-webui/chat/1.3/docker-compose.yml rename to linux/ecosystem/freegpt-webui/1.3/docker-compose.yml diff --git a/linux/ecosystem/freegpt-webui/1.3/etc/supervisor/conf.d/freegpt.conf b/linux/ecosystem/freegpt-webui/1.3/etc/supervisor/conf.d/freegpt.conf new file mode 100644 index 000000000..e332d2acd --- /dev/null +++ b/linux/ecosystem/freegpt-webui/1.3/etc/supervisor/conf.d/freegpt.conf @@ -0,0 +1,38 @@ +[unix_http_server] +file=/var/run/supervisor.sock ; (the path to the socket file) +chmod=0700 ; sockef file mode (default 0700) +username = freegpt +password = freegpt + +[supervisord] +logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log) +pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid) +childlogdir=/var/log/supervisor ; ('AUTO' child log dir, default $TEMP) +nodaemon=true +user=root + +[rpcinterface:supervisor] +supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface + +[supervisorctl] +serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL for a unix socket +username = freegpt +password = freegpt + +[program:freegpt-webui] +command=/usr/local/bin/python3.10 /app/run.py +directory=/app +user=root +autostart=true +autorestart=unexpected +priority=666 +startsecs=5 + +[program:freegpt-endpoint] +command=/usr/local/bin/python3.10 /app/endpoint.py +directory=/app +user=root +autostart=true +autorestart=unexpected +priority=777 +startsecs=7 diff --git a/linux/ecosystem/freegpt-webui/chat/1.4/Dockerfile b/linux/ecosystem/freegpt-webui/1.4/Dockerfile similarity index 74% rename from linux/ecosystem/freegpt-webui/chat/1.4/Dockerfile rename to linux/ecosystem/freegpt-webui/1.4/Dockerfile index 6ad3bdbcb..036493d77 100644 --- a/linux/ecosystem/freegpt-webui/chat/1.4/Dockerfile +++ b/linux/ecosystem/freegpt-webui/1.4/Dockerfile @@ -11,8 +11,7 @@ ARG FREEGPT_VERSION=1.4 ENV FREEGPT_PATH=/app ENV FREEGPT_PORT=1338 -ENV FREEGTP_PY_BIN=/root/.local/bin -ENV PATH=/root/.local/bin:$PATH +ENV FREEGPT_ENDPOINT_PORT=1337 RUN git clone --depth 1 --branch ${FREEGPT_VERSION} https://github.com/Em1tSan/freegpt-webui-ru.git ${FREEGPT_PATH} && \ rm -rfv ${FREEGPT_PATH}/.git @@ -24,6 +23,8 @@ RUN apt-get update && \ libcurl4-openssl-dev && \ pip3 install --user --no-cache-dir -r ${FREEGPT_PATH}/requirements-docker.txt +RUN find ${FREEGPT_PATH} -type f -exec dos2unix -k -s -o {} ';' + ################################################################## ################################################################## ################################################################## @@ -35,16 +36,24 @@ FROM epicmorg/python:3.10 AS production ENV FREEGPT_PATH=/app ENV FREEGPT_PORT=1338 -ENV FREEGTP_PY_BIN=/root/.local/bin -ENV PATH=/root/.local/bin:$PATH +ENV FREEGPT_ENDPOINT_PORT=1337 -RUN mkdir -p ${FREEGTP_PY_BIN} ${FREEGPT_PATH} +RUN mkdir -p ${FREEGPT_PATH} + +################################################################## +# Setup supervisord +################################################################## +RUN apt-get update && \ + apt-get install -y \ + supervisor + +COPY etc/supervisor/conf.d/supervisord.conf /etc/supervisor/conf.d/supervisord.conf ################################################################## # Copy bins ################################################################## -COPY --from=build /root/.local /root/.local -COPY --from=build /app /app +COPY --from=build /root/.local /usr/local +COPY --from=build /app ${FREEGPT_PATH} ################################################################## # cleaninig up @@ -57,6 +66,6 @@ RUN apt clean -y && \ rm -rfv /tmp/* WORKDIR ${FREEGPT_PATH} -EXPOSE ${FREEGPT_PORT} +EXPOSE ${FREEGPT_PORT} ${FREEGPT_ENDPOINT_PORT} -CMD ["python3", "./run.py"] +CMD ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisor/conf.d/freegpt.conf"] diff --git a/linux/ecosystem/freegpt-webui/chat/1.4/Makefile b/linux/ecosystem/freegpt-webui/1.4/Makefile similarity index 100% rename from linux/ecosystem/freegpt-webui/chat/1.4/Makefile rename to linux/ecosystem/freegpt-webui/1.4/Makefile diff --git a/linux/ecosystem/freegpt-webui/chat/1.4/docker-compose.yml b/linux/ecosystem/freegpt-webui/1.4/docker-compose.yml similarity index 100% rename from linux/ecosystem/freegpt-webui/chat/1.4/docker-compose.yml rename to linux/ecosystem/freegpt-webui/1.4/docker-compose.yml diff --git a/linux/ecosystem/freegpt-webui/1.4/etc/supervisor/conf.d/freegpt.conf b/linux/ecosystem/freegpt-webui/1.4/etc/supervisor/conf.d/freegpt.conf new file mode 100644 index 000000000..e332d2acd --- /dev/null +++ b/linux/ecosystem/freegpt-webui/1.4/etc/supervisor/conf.d/freegpt.conf @@ -0,0 +1,38 @@ +[unix_http_server] +file=/var/run/supervisor.sock ; (the path to the socket file) +chmod=0700 ; sockef file mode (default 0700) +username = freegpt +password = freegpt + +[supervisord] +logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log) +pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid) +childlogdir=/var/log/supervisor ; ('AUTO' child log dir, default $TEMP) +nodaemon=true +user=root + +[rpcinterface:supervisor] +supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface + +[supervisorctl] +serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL for a unix socket +username = freegpt +password = freegpt + +[program:freegpt-webui] +command=/usr/local/bin/python3.10 /app/run.py +directory=/app +user=root +autostart=true +autorestart=unexpected +priority=666 +startsecs=5 + +[program:freegpt-endpoint] +command=/usr/local/bin/python3.10 /app/endpoint.py +directory=/app +user=root +autostart=true +autorestart=unexpected +priority=777 +startsecs=7 diff --git a/linux/ecosystem/freegpt-webui/README.md b/linux/ecosystem/freegpt-webui/README.md index 32a288808..3d81856b2 100644 --- a/linux/ecosystem/freegpt-webui/README.md +++ b/linux/ecosystem/freegpt-webui/README.md @@ -3,32 +3,21 @@ * Improved docker images. * Original repo here: [Em1tSan/freegpt-webui-ru](https://github.com/Em1tSan/freegpt-webui-ru) -## Ready docker-compose example +* All versions now running by `supervisord` instead of direct `CMD python3 ./run.py` +* Since `v1.3+` image contain **both** applications in background - `webui` chat (via port `1338`) and `endpoint` api (via port `1337`). -### Normal WebUI (All versions) +# Ready docker-compose example ```yml version: "3.9" services: freegpt-webui: - image: epicmorg/freegpt-webui:latest #1.3.2, 1.3.1, etc - container_name: freegpt-webui - hostname: freegpt-webui - restart: always - ports: - - 1338:1338 -``` - -### Endpoint API (v1.3+ only) - -```yml -version: "3.9" -services: - freegpt-webui: - image: epicmorg/freegpt-webui:latest-endpoint # 1.3, 1.3.1, 1.3.2, 1.4, etc + image: epicmorg/freegpt-webui:latest #1.3.2, <...>, 1.0, etc container_name: freegpt-webui hostname: freegpt-webui restart: always ports: - 1337:1337 + - 1338:1338 ``` + diff --git a/linux/ecosystem/freegpt-webui/endpoint/1.3.1/Dockerfile b/linux/ecosystem/freegpt-webui/endpoint/1.3.1/Dockerfile deleted file mode 100644 index be067436e..000000000 --- a/linux/ecosystem/freegpt-webui/endpoint/1.3.1/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -################################################################## -################################################################## -################################################################## -# Production stage -################################################################## -################################################################## -################################################################## -FROM epicmorg/freegpt-webui:1.3.1 AS production - -ENV FREEGPT_PORT=1337 -CMD ["python3", "./endpoint.py"] diff --git a/linux/ecosystem/freegpt-webui/endpoint/1.3.1/Makefile b/linux/ecosystem/freegpt-webui/endpoint/1.3.1/Makefile deleted file mode 100644 index a15587318..000000000 --- a/linux/ecosystem/freegpt-webui/endpoint/1.3.1/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -all: app - -app: - make build - make deploy - make clean - -build: - docker-compose build --compress --no-cache --progress plain - -deploy: - docker-compose push - -clean: - docker container prune -f - docker image prune -f - docker network prune -f - docker volume prune -f - docker system prune -af diff --git a/linux/ecosystem/freegpt-webui/endpoint/1.3.1/docker-compose.yml b/linux/ecosystem/freegpt-webui/endpoint/1.3.1/docker-compose.yml deleted file mode 100644 index 77cc09abd..000000000 --- a/linux/ecosystem/freegpt-webui/endpoint/1.3.1/docker-compose.yml +++ /dev/null @@ -1,6 +0,0 @@ -version: '3.9' -services: - app: - image: "epicmorg/freegpt-webui:1.3.1-endpoint" - build: - context: . diff --git a/linux/ecosystem/freegpt-webui/endpoint/1.3.2/Dockerfile b/linux/ecosystem/freegpt-webui/endpoint/1.3.2/Dockerfile deleted file mode 100644 index 65c1ae6bf..000000000 --- a/linux/ecosystem/freegpt-webui/endpoint/1.3.2/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -################################################################## -################################################################## -################################################################## -# Production stage -################################################################## -################################################################## -################################################################## -FROM epicmorg/freegpt-webui:1.3.2 AS production - -ENV FREEGPT_PORT=1337 -CMD ["python3", "./endpoint.py"] diff --git a/linux/ecosystem/freegpt-webui/endpoint/1.3.2/Makefile b/linux/ecosystem/freegpt-webui/endpoint/1.3.2/Makefile deleted file mode 100644 index a15587318..000000000 --- a/linux/ecosystem/freegpt-webui/endpoint/1.3.2/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -all: app - -app: - make build - make deploy - make clean - -build: - docker-compose build --compress --no-cache --progress plain - -deploy: - docker-compose push - -clean: - docker container prune -f - docker image prune -f - docker network prune -f - docker volume prune -f - docker system prune -af diff --git a/linux/ecosystem/freegpt-webui/endpoint/1.3.2/docker-compose.yml b/linux/ecosystem/freegpt-webui/endpoint/1.3.2/docker-compose.yml deleted file mode 100644 index 1eb3cf1e5..000000000 --- a/linux/ecosystem/freegpt-webui/endpoint/1.3.2/docker-compose.yml +++ /dev/null @@ -1,6 +0,0 @@ -version: '3.9' -services: - app: - image: "epicmorg/freegpt-webui:1.3.2-endpoint" - build: - context: . diff --git a/linux/ecosystem/freegpt-webui/endpoint/1.3/Dockerfile b/linux/ecosystem/freegpt-webui/endpoint/1.3/Dockerfile deleted file mode 100644 index 7ba5910e6..000000000 --- a/linux/ecosystem/freegpt-webui/endpoint/1.3/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -################################################################## -################################################################## -################################################################## -# Production stage -################################################################## -################################################################## -################################################################## -FROM epicmorg/freegpt-webui:1.3 AS production - -ENV FREEGPT_PORT=1337 -CMD ["python3", "./endpoint.py"] diff --git a/linux/ecosystem/freegpt-webui/endpoint/1.3/Makefile b/linux/ecosystem/freegpt-webui/endpoint/1.3/Makefile deleted file mode 100644 index a15587318..000000000 --- a/linux/ecosystem/freegpt-webui/endpoint/1.3/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -all: app - -app: - make build - make deploy - make clean - -build: - docker-compose build --compress --no-cache --progress plain - -deploy: - docker-compose push - -clean: - docker container prune -f - docker image prune -f - docker network prune -f - docker volume prune -f - docker system prune -af diff --git a/linux/ecosystem/freegpt-webui/endpoint/1.3/docker-compose.yml b/linux/ecosystem/freegpt-webui/endpoint/1.3/docker-compose.yml deleted file mode 100644 index e3cd18217..000000000 --- a/linux/ecosystem/freegpt-webui/endpoint/1.3/docker-compose.yml +++ /dev/null @@ -1,6 +0,0 @@ -version: '3.9' -services: - app: - image: "epicmorg/freegpt-webui:1.3-endpoint" - build: - context: . diff --git a/linux/ecosystem/freegpt-webui/endpoint/1.4/Dockerfile b/linux/ecosystem/freegpt-webui/endpoint/1.4/Dockerfile deleted file mode 100644 index 8349cb737..000000000 --- a/linux/ecosystem/freegpt-webui/endpoint/1.4/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -################################################################## -################################################################## -################################################################## -# Production stage -################################################################## -################################################################## -################################################################## -FROM epicmorg/freegpt-webui:1.4 AS production - -ENV FREEGPT_PORT=1337 -CMD ["python3", "./endpoint.py"] diff --git a/linux/ecosystem/freegpt-webui/endpoint/1.4/Makefile b/linux/ecosystem/freegpt-webui/endpoint/1.4/Makefile deleted file mode 100644 index a15587318..000000000 --- a/linux/ecosystem/freegpt-webui/endpoint/1.4/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -all: app - -app: - make build - make deploy - make clean - -build: - docker-compose build --compress --no-cache --progress plain - -deploy: - docker-compose push - -clean: - docker container prune -f - docker image prune -f - docker network prune -f - docker volume prune -f - docker system prune -af diff --git a/linux/ecosystem/freegpt-webui/endpoint/1.4/docker-compose.yml b/linux/ecosystem/freegpt-webui/endpoint/1.4/docker-compose.yml deleted file mode 100644 index 32fbf0d18..000000000 --- a/linux/ecosystem/freegpt-webui/endpoint/1.4/docker-compose.yml +++ /dev/null @@ -1,6 +0,0 @@ -version: '3.9' -services: - app: - image: "epicmorg/freegpt-webui:1.4-endpoint" - build: - context: . diff --git a/linux/ecosystem/freegpt-webui/endpoint/latest/Dockerfile b/linux/ecosystem/freegpt-webui/endpoint/latest/Dockerfile deleted file mode 100644 index 7fd0b4120..000000000 --- a/linux/ecosystem/freegpt-webui/endpoint/latest/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -################################################################## -################################################################## -################################################################## -# Production stage -################################################################## -################################################################## -################################################################## -FROM epicmorg/freegpt-webui:latest AS production - -ENV FREEGPT_PORT=1337 -CMD ["python3", "./endpoint.py"] diff --git a/linux/ecosystem/freegpt-webui/endpoint/latest/Makefile b/linux/ecosystem/freegpt-webui/endpoint/latest/Makefile deleted file mode 100644 index a15587318..000000000 --- a/linux/ecosystem/freegpt-webui/endpoint/latest/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -all: app - -app: - make build - make deploy - make clean - -build: - docker-compose build --compress --no-cache --progress plain - -deploy: - docker-compose push - -clean: - docker container prune -f - docker image prune -f - docker network prune -f - docker volume prune -f - docker system prune -af diff --git a/linux/ecosystem/freegpt-webui/endpoint/latest/docker-compose.yml b/linux/ecosystem/freegpt-webui/endpoint/latest/docker-compose.yml deleted file mode 100644 index 1aa8cc4a4..000000000 --- a/linux/ecosystem/freegpt-webui/endpoint/latest/docker-compose.yml +++ /dev/null @@ -1,6 +0,0 @@ -version: '3.9' -services: - app: - image: "epicmorg/freegpt-webui:latest-endpoint" - build: - context: . diff --git a/linux/ecosystem/freegpt-webui/chat/latest/Dockerfile b/linux/ecosystem/freegpt-webui/latest/Dockerfile similarity index 74% rename from linux/ecosystem/freegpt-webui/chat/latest/Dockerfile rename to linux/ecosystem/freegpt-webui/latest/Dockerfile index af488845c..9889d32da 100644 --- a/linux/ecosystem/freegpt-webui/chat/latest/Dockerfile +++ b/linux/ecosystem/freegpt-webui/latest/Dockerfile @@ -9,8 +9,7 @@ FROM epicmorg/python:3.10-develop AS build ENV FREEGPT_PATH=/app ENV FREEGPT_PORT=1338 -ENV FREEGTP_PY_BIN=/root/.local/bin -ENV PATH=/root/.local/bin:$PATH +ENV FREEGPT_ENDPOINT_PORT=1337 RUN git clone https://github.com/Em1tSan/freegpt-webui-ru.git ${FREEGPT_PATH} && \ rm -rfv ${FREEGPT_PATH}/.git @@ -22,6 +21,8 @@ RUN apt-get update && \ libcurl4-openssl-dev && \ pip3 install --user --no-cache-dir -r ${FREEGPT_PATH}/requirements-docker.txt +RUN find ${FREEGPT_PATH} -type f -exec dos2unix -k -s -o {} ';' + ################################################################## ################################################################## ################################################################## @@ -33,16 +34,24 @@ FROM epicmorg/python:3.10 AS production ENV FREEGPT_PATH=/app ENV FREEGPT_PORT=1338 -ENV FREEGTP_PY_BIN=/root/.local/bin -ENV PATH=/root/.local/bin:$PATH +ENV FREEGPT_ENDPOINT_PORT=1337 -RUN mkdir -p ${FREEGTP_PY_BIN} ${FREEGPT_PATH} +RUN mkdir -p ${FREEGPT_PATH} + +################################################################## +# Setup supervisord +################################################################## +RUN apt-get update && \ + apt-get install -y \ + supervisor + +COPY etc/supervisor/conf.d/freegpt.conf /etc/supervisor/conf.d/freegpt.conf ################################################################## # Copy bins ################################################################## -COPY --from=build /root/.local /root/.local -COPY --from=build /app /app +COPY --from=build /root/.local /usr/local +COPY --from=build /app ${FREEGPT_PATH} ################################################################## # cleaninig up @@ -55,6 +64,6 @@ RUN apt clean -y && \ rm -rfv /tmp/* WORKDIR ${FREEGPT_PATH} -EXPOSE ${FREEGPT_PORT} +EXPOSE ${FREEGPT_PORT} ${FREEGPT_ENDPOINT_PORT} -CMD ["python3", "./run.py"] +CMD ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisor/conf.d/freegpt.conf"] diff --git a/linux/ecosystem/freegpt-webui/chat/latest/Makefile b/linux/ecosystem/freegpt-webui/latest/Makefile similarity index 100% rename from linux/ecosystem/freegpt-webui/chat/latest/Makefile rename to linux/ecosystem/freegpt-webui/latest/Makefile diff --git a/linux/ecosystem/freegpt-webui/chat/latest/docker-compose.yml b/linux/ecosystem/freegpt-webui/latest/docker-compose.yml similarity index 100% rename from linux/ecosystem/freegpt-webui/chat/latest/docker-compose.yml rename to linux/ecosystem/freegpt-webui/latest/docker-compose.yml diff --git a/linux/ecosystem/freegpt-webui/latest/etc/supervisor/conf.d/freegpt.conf b/linux/ecosystem/freegpt-webui/latest/etc/supervisor/conf.d/freegpt.conf new file mode 100644 index 000000000..e332d2acd --- /dev/null +++ b/linux/ecosystem/freegpt-webui/latest/etc/supervisor/conf.d/freegpt.conf @@ -0,0 +1,38 @@ +[unix_http_server] +file=/var/run/supervisor.sock ; (the path to the socket file) +chmod=0700 ; sockef file mode (default 0700) +username = freegpt +password = freegpt + +[supervisord] +logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log) +pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid) +childlogdir=/var/log/supervisor ; ('AUTO' child log dir, default $TEMP) +nodaemon=true +user=root + +[rpcinterface:supervisor] +supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface + +[supervisorctl] +serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL for a unix socket +username = freegpt +password = freegpt + +[program:freegpt-webui] +command=/usr/local/bin/python3.10 /app/run.py +directory=/app +user=root +autostart=true +autorestart=unexpected +priority=666 +startsecs=5 + +[program:freegpt-endpoint] +command=/usr/local/bin/python3.10 /app/endpoint.py +directory=/app +user=root +autostart=true +autorestart=unexpected +priority=777 +startsecs=7