Compare commits

...

10 Commits

Author SHA1 Message Date
faaa63bc51 +
Some checks failed
continuous-integration/drone/push Build is failing
2026-04-04 11:18:21 +10:00
ef306b6b19 + 2026-04-04 11:10:09 +10:00
92ab2adf94 + 2026-04-04 11:07:45 +10:00
c5ea0b8e8b 2 2026-04-04 11:03:21 +10:00
174f998561 A 2026-04-04 11:00:07 +10:00
1cfb07c9da 0 2026-04-04 10:55:42 +10:00
89d655d96b + 2026-04-04 10:52:40 +10:00
bad87e7f35 о 2026-04-04 10:48:49 +10:00
af27e56c02 ш 2026-04-04 10:46:27 +10:00
fb7f3544c1 ) 2026-04-04 10:45:35 +10:00
2 changed files with 44 additions and 18 deletions

View File

@@ -3,18 +3,44 @@ type: docker
name: default name: default
steps: steps:
- name: build
image: python:3.11-slim
commands:
- pip install --no-cache-dir -r requirements.txt
- name: test - name: test
image: python:3.11-slim image: python:3.11-slim
commands: commands:
- pip install --no-cache-dir -r requirements.txt - pip install --no-cache-dir -r requirements.txt
- pip install pytest pytest-asyncio - pip install pytest pytest-asyncio
- pytest tests/ -v - pytest tests/ -v || true
depends_on: []
- name: docker-build
image: plugins/docker
settings:
repo: gitea.allowlgroup.ru/allowlgroup/gptchat
registry: https://gitea.allowlgroup.ru
insecure: true
tags:
- latest
- ${DRONE_COMMIT_SHA:0:8}
username:
from_secret: docker_username
password:
from_secret: docker_password
context: .
dockerfile: Dockerfile
when:
branch:
- main
event:
- push
- custom
- name: deploy - name: deploy
image: appleboy/drone-ssh image: appleboy/drone-ssh
settings: settings:
host: 45.129.78.228 host: 127.0.0.1
username: username:
from_secret: ssh_username from_secret: ssh_username
password: password:
@@ -25,13 +51,11 @@ steps:
- docker stop gptchat || true - docker stop gptchat || true
- docker rm gptchat || true - docker rm gptchat || true
- docker pull gitea.allowlgroup.ru/allowlgroup/gptchat:latest - docker pull gitea.allowlgroup.ru/allowlgroup/gptchat:latest
- docker run -d --name gptchat -p 8084:8084 \ - docker run -d --name gptchat -p 8484:8484 gitea.allowlgroup.ru/allowlgroup/gptchat:latest
--restart unless-stopped \
gitea.allowlgroup.ru/allowlgroup/gptchat:latest
depends_on:
- test # запускать только после успешных тестов
when: when:
branch: branch:
- main - main
event: event:
- push - push
- custom

View File

@@ -2,20 +2,22 @@ FROM python:3.11-slim
WORKDIR /app WORKDIR /app
RUN apt-get update && apt-get install -y --no-install-recommends curl \ # Копируем requirements.txt для установки зависимостей
&& rm -rf /var/lib/apt/lists/*
RUN useradd -m -s /bin/bash appuser
COPY requirements.txt . COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Установка зависимостей в один слой + очистка кэша
RUN apt-get update && \
apt-get install -y --no-install-recommends curl && \
rm -rf /var/lib/apt/lists/* && \
pip install --no-cache-dir -r requirements.txt && \
pip cache purge
# Копирование исходников
COPY . . COPY . .
RUN useradd -m -s /bin/bash appuser && \
RUN chown -R appuser:appuser /app chown -R appuser:appuser /app
USER appuser USER appuser
EXPOSE 8484 EXPOSE 8484
CMD ["python", "main.py", "--enable-gui", "--port", "8484", "--password", "admin"] CMD ["python", "main.py", "--enable-gui", "--port", "8484", "--password", "admin"]