implement proper docker compose with database
This commit is contained in:
parent
2f300b2759
commit
a7d9a85efa
4 changed files with 21 additions and 13 deletions
|
|
@ -1,9 +0,0 @@
|
||||||
services:
|
|
||||||
mk-dl-bot:
|
|
||||||
build: .
|
|
||||||
env_file:
|
|
||||||
- .env
|
|
||||||
volumes:
|
|
||||||
- db:/var/lib/mk-dl-bot
|
|
||||||
volumes:
|
|
||||||
db:
|
|
||||||
|
|
@ -1,5 +1,23 @@
|
||||||
services:
|
services:
|
||||||
mk-dl-bot:
|
postgresdb:
|
||||||
|
image: postgres:alpine
|
||||||
|
env_file:
|
||||||
|
- .env
|
||||||
|
volumes:
|
||||||
|
- db:/var/lib/postgres
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "pg_isready"]
|
||||||
|
interval: 1m30s
|
||||||
|
timeout: 30s
|
||||||
|
retries: 5
|
||||||
|
start_period: 30s
|
||||||
|
|
||||||
|
bot:
|
||||||
build: .
|
build: .
|
||||||
env_file:
|
env_file:
|
||||||
- .env
|
- .env
|
||||||
|
depends_on:
|
||||||
|
- postgresdb
|
||||||
|
restart: on-failure
|
||||||
|
volumes:
|
||||||
|
db:
|
||||||
|
|
@ -130,7 +130,6 @@ enum Command {
|
||||||
|
|
||||||
async fn cmd_test(bot: Bot, msg: Message, _db: DbPool) -> HandlerResult {
|
async fn cmd_test(bot: Bot, msg: Message, _db: DbPool) -> HandlerResult {
|
||||||
bot.send_message(msg.chat.id, t!("test_response")).await?;
|
bot.send_message(msg.chat.id, t!("test_response")).await?;
|
||||||
dbg!(msg);
|
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ rust_i18n::i18n!("locales");
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() -> anyhow::Result<()> {
|
async fn main() -> anyhow::Result<()> {
|
||||||
if cfg!(debug_assertions) {
|
if cfg!(debug_assertions) {
|
||||||
dotenv().ok();
|
dotenv::from_filename(".env.dev").ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
log_init();
|
log_init();
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue