+
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2026-04-04 14:08:22 +10:00
parent c488e8012f
commit db21911652
3 changed files with 68 additions and 2 deletions

53
.drone.yml Normal file
View File

@@ -0,0 +1,53 @@
kind: pipeline
type: docker
name: default
steps:
- name: build
image: python:3.11-slim
commands:
- pip install --no-cache-dir -r requirements.txt
- name: docker-build
image: plugins/docker
settings:
repo: gitea.allowlgroup.ru/allowlgroup/parser_bd
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
image: appleboy/drone-ssh
settings:
host: allowlgroup.ru
username:
from_secret: ssh_username
password:
from_secret: ssh_password
port: 22
script:
- docker stop parser_bd || true
- docker rm parser_bd || true
- docker pull gitea.allowlgroup.ru/allowlgroup/parser_bd:latest
- docker run -d --name parser_bd -p 8002:8002 gitea.allowlgroup.ru/allowlgroup/parser_bd:latest
when:
branch:
- main
event:
- push
- custom

13
Dockerfile Normal file
View File

@@ -0,0 +1,13 @@
FROM python:3.11-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
EXPOSE 8002
# Запуск с uvicorn
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8002"]

View File

@@ -40,8 +40,8 @@ def get_connection():
dbname="parsed_url", dbname="parsed_url",
user="postgres", user="postgres",
password="qwertyqwerty123123", password="qwertyqwerty123123",
host="127.0.0.1" # host="127.0.0.1"
# host ="45.129.78.228" host ="45.129.78.228"
) )
@app.post("/save_parsed_data", summary="Сохранить данные парсинга") @app.post("/save_parsed_data", summary="Сохранить данные парсинга")