From d0bc379518f7a8786e9e7c6dc47545dc4139aef1 Mon Sep 17 00:00:00 2001 From: Sergey Elpashev Date: Fri, 27 Dec 2024 15:48:24 +0300 Subject: [PATCH] Feat: test woodpecker ci --- .woodpecker.yml | 13 +++++++++++++ Dockerfile | 4 ++-- docker-compose.yml | 5 ++--- run.sh | 7 +++++++ 4 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 run.sh diff --git a/.woodpecker.yml b/.woodpecker.yml index e69de29..8b581e0 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -0,0 +1,13 @@ +when: + - event: push + branch: test + +steps: + - name: build + image: docker:latest + commands: + - docker build -t test . + - name: deploy + image: docker:latest + commands: + - sh run.sh \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 7cdffe5..7b51dfe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.13.1-slim +FROM python:3.13.1-alpine WORKDIR /app @@ -14,4 +14,4 @@ COPY . . ENV POSTGRES_PORT=5432 -CMD ["python", "main.py"] \ No newline at end of file +CMD ["python", "main.py"] diff --git a/docker-compose.yml b/docker-compose.yml index 9c4aaf3..7d25aaa 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,11 +8,10 @@ services: networks: - bot_network depends_on: - db: - condition: service_healthy + - db db: - image: postgres:alpine + image: postgres:17-alpine deploy: replicas: 1 restart_policy: diff --git a/run.sh b/run.sh new file mode 100644 index 0000000..03bca8a --- /dev/null +++ b/run.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +set -e + +export $(grep -E -v '^#' .env | xargs) + +docker stack deploy -c docker-compose.yml aboba \ No newline at end of file