chore: add pipeline
dev / deploy (push) Failing after 1m27s

This commit is contained in:
Daniil
2026-04-29 23:48:19 +03:00
parent b9030a863e
commit 97705a23df
3 changed files with 91 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
name: dev
on:
push:
branches:
- master
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Write env file
env:
DEV_ENV: ${{ secrets.ENV_DEV }}
run: |
test -n "$ENV_DEV"
umask 077
printf '%s\n' "$ENV_DEV" > .env
- name: Deploy backend
run: docker compose -f docker-compose.dev.yml up -d --build --remove-orphans
+67
View File
@@ -0,0 +1,67 @@
x-backend: &backend
image: cofee-backend:dev
build:
context: .
dockerfile: Dockerfile
target: prod
env_file:
- .env
restart: unless-stopped
volumes:
- ~/srv/storage/cofee_backend_api/.certs:/app/.certs:ro
- ~/srv/storage/cofee_backend_api/.artifacts:/app/.artifacts
networks:
- services_local
services:
api:
<<: *backend
container_name: cofee_backend_api
labels:
- "traefik.enable=true"
- "traefik.docker.network=proxy"
- "traefik.http.routers.cofee-backend.rule=Host(`api.trimgu.ru`)"
- "traefik.http.routers.cofee-backend.entrypoints=websecure"
- "traefik.http.routers.cofee-backend.service=cofee-backend"
- "traefik.http.services.cofee-backend.loadbalancer.server.port=8000"
networks:
- services_local
- proxy
healthcheck:
test:
[
"CMD",
"python",
"-c",
"import urllib.request;
urllib.request.urlopen('http://localhost:8000/api/health/')",
]
interval: 30s
timeout: 5s
retries: 3
start_period: 30s
worker:
<<: *backend
container_name: cofee_backend_worker
command:
[
"dramatiq",
"cpv3.modules.tasks.service",
"--processes",
"1",
"--threads",
"2",
]
healthcheck:
test: [ "CMD-SHELL", "pgrep -f dramatiq || exit 1" ]
interval: 30s
timeout: 5s
retries: 3
start_period: 30s
networks:
services_local:
external: true
proxy:
external: true