Compare commits

...

2 Commits

Author SHA1 Message Date
b909c77180 Feat: move from stack to compose
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2024-12-28 09:50:57 +03:00
1f6ed3d09c Feat: .env example
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2024-12-27 21:14:04 +03:00
4 changed files with 20 additions and 12 deletions

7
.env.example Normal file
View File

@@ -0,0 +1,7 @@
BOT_TOKEN=token
DEBUG=1
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_DB=postgres
POSTGRES_HOST=postgres
POSTGRES_PORT=5432

View File

@@ -18,7 +18,7 @@ steps:
image: docker:latest
commands:
- echo "$ENV_FILE" > .env
- sh run.sh
- docker compose up -d
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:

View File

@@ -1,21 +1,22 @@
services:
bot:
image: nwxraybot:latest
deploy:
replicas: 1
restart_policy:
condition: on-failure
restart: always
container_name: nwxraybot_bot
build:
context: .
dockerfile: Dockerfile
networks:
- bot_network
depends_on:
- db
db:
condition: service_healthy
restart: true
db:
image: postgres:17-alpine
deploy:
replicas: 1
restart_policy:
condition: on-failure
container_name: nwxraybot_db
restart: always
environment:
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
POSTGRES_USER: ${POSTGRES_USER:-postgres}
@@ -35,7 +36,6 @@ services:
networks:
bot_network:
driver: overlay
volumes:
postgres_data:

View File

@@ -1,5 +1,5 @@
from pydantic import Field, SecretStr
from pydantic_settings import BaseSettings
from pydantic_settings import BaseSettings, SettingsConfigDict
class Settings(BaseSettings):
@@ -19,3 +19,4 @@ class Settings(BaseSettings):
class Config:
env_file = ".env"
env_file_encoding = "utf-8"
extra = "allow"