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 5e148c1..65eb46c 100644 Binary files a/requirements.txt and b/requirements.txt differ