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