chore: Docker improvments
All checks were successful
Write changelog / write-changelog (push) Successful in 3s
Update Contributors / Update Contributors (push) Successful in 4s
Rust CI / Rust CI (push) Successful in 5m33s

Replace `as` with `AS`
- Remove `version` from `docker-compose.yml`
- Add database configration to oxidetalis environment
- Add `healthcheck` for the database

Signed-off-by: Awiteb <a@4rs.nl>
This commit is contained in:
Awiteb 2024-07-23 00:25:06 +03:00
parent 98a02e0370
commit 672d7a2d3c
Signed by: awiteb
GPG key ID: 3F6B55640AA6682F
2 changed files with 17 additions and 2 deletions

View file

@ -1,4 +1,4 @@
FROM rust:1.70.0-slim-bullseye as builder FROM rust:1.70.0-slim-bullseye AS builder
WORKDIR /builder WORKDIR /builder

View file

@ -1,4 +1,3 @@
version: '3'
services: services:
oxidetalis: oxidetalis:
container_name: oxidetalis container_name: oxidetalis
@ -6,7 +5,17 @@ services:
context: ./ context: ./
dockerfile: ./crates/oxidetalis/Dockerfile dockerfile: ./crates/oxidetalis/Dockerfile
environment: environment:
# Logging level
- RUST_LOG=info
- OXIDETALIS_CONFIG=/app/config.toml - OXIDETALIS_CONFIG=/app/config.toml
# In docker host
- OXIDETALIS_SERVER_HOST=0.0.0.0
# Connect to the below db
- OXIDETALIS_DB_HOST=db
- OXIDETALIS_DB_PORT=5432
- OXIDETALIS_DB_USER=oxidetalis
- OXIDETALIS_DB_PASSWORD=oxidetalis
- OXIDETALIS_DB_NAME=oxidetalis_db
ports: ports:
- 127.0.0.1:7294:7294 - 127.0.0.1:7294:7294
depends_on: depends_on:
@ -20,6 +29,12 @@ services:
POSTGRES_USER: oxidetalis POSTGRES_USER: oxidetalis
POSTGRES_PASSWORD: oxidetalis POSTGRES_PASSWORD: oxidetalis
POSTGRES_DB: oxidetalis_db POSTGRES_DB: oxidetalis_db
healthcheck:
test: ["CMD-SHELL", "pg_isready", "-d", "db_prod"]
interval: 30s
timeout: 60s
retries: 5
start_period: 80s
# This for devlopment only # This for devlopment only
ports: ports:
- 127.0.0.1:5432:5432 - 127.0.0.1:5432:5432