From c7dd44f87da72d290d15b5de6f41925319b27387 Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 4 Apr 2026 14:12:40 +1000 Subject: [PATCH] yjdjt --- .drone.yml | 51 +++++++++++++++++++++++++++++++++++++++++++++++ Dockerfile | 13 ++++++++++++ main.py | 2 +- requirements.txt | Bin 572 -> 798 bytes 4 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 .drone.yml create mode 100644 Dockerfile diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..0978ce9 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,51 @@ +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: 217.11.166.147:3000/admin/auth_bd + registry: http://217.11.166.147:3000 + 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: 217.11.166.147 + username: + from_secret: ssh_username + password: + from_secret: ssh_password + port: 22 + script: + - docker stop auth_bd || true + - docker rm auth_bd || true + - docker pull 217.11.166.147:3000/admin/auth_bd:latest + - docker run -d --name auth_bd -p 8004:8004 217.11.166.147:3000/admin/auth_bd:latest + when: + branch: + - main + event: + - push + - custom \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b2a0a84 --- /dev/null +++ b/Dockerfile @@ -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 8004 + +# Запуск с uvicorn +CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8004"] \ No newline at end of file diff --git a/main.py b/main.py index ae27c20..be36a6b 100644 --- a/main.py +++ b/main.py @@ -14,7 +14,7 @@ app = FastAPI(title="Work BD Auth API", app.add_middleware( CORSMiddleware, - allow_origins=["https://allowlgroup.ru","http://localhost:5173", "http://45.129.78.228:8000"], # или список конкретных доменов + allow_origins=["*"], # или список конкретных доменов allow_credentials=True, allow_methods=["*"], allow_headers=["*"], diff --git a/requirements.txt b/requirements.txt index 5e148c19c2e0bec830a8c9bfe02fc59085db5949..65eb46cd945d40e8cfcba767c2e8ff4828980290 100644 GIT binary patch delta 232 zcmdnPGLLP-EyHAn9EMDWWQJ@8TOhPx&|@$LVnYUA1}>mzK2SEFp@<=oAs2{2Dhwu` zRh2bnFoi4104g?wNP)%7CVo|P^aZLe0-9OMP{0rjWT!Etf|Y>GHUMH{u=xc*nPMOW zxgZHFZwQn#2V#@Wf{faXE~N}*V8?-+kO#NJguw`G49JP$K!ZURRRQTzhIF_kAcM@n GmH+^fizSf& delta 23 fcmbQowufcHt;rIM63j*nmXm!M6*q5TRAU4HSmy?k