feat: update compose.yml for slim build and reintroduce database services

This commit is contained in:
grillazz
2026-06-12 13:55:17 +02:00
parent 42d0f20475
commit 24bbcae2a6
2 changed files with 45 additions and 45 deletions
+2 -2
View File
@@ -75,8 +75,8 @@ slim-build: ## Build smaller and more secure Docker images with docker-slim
docker-slim build --compose-file compose.yml \ docker-slim build --compose-file compose.yml \
--target-compose-svc api1 \ --target-compose-svc api1 \
--dep-include-target-compose-svc-deps true \ --dep-include-target-compose-svc-deps true \
--http-probe-exec api1 fastapi-sqlalchemy-asyncpg-api1:latest \ --preserve-path panettone --include-path panettone \
--include-path /panettone/lib/python3.14 --http-probe-exec api1 fastapi-sqlalchemy-asyncpg-api1:latest
# ==================================================================================== # ====================================================================================
# DATABASE SEEDING # DATABASE SEEDING
+43 -43
View File
@@ -1,7 +1,7 @@
services: services:
api1: api1:
container_name: panettone_api1 container_name: panettone_api1
image: fastapi-sqlalchemy-asyncpg-api1.slim:latest build: .
environment: environment:
- PYTHONPATH=/panettone - PYTHONPATH=/panettone
env_file: env_file:
@@ -19,45 +19,45 @@ services:
- ./alembic:/panettone/alembic - ./alembic:/panettone/alembic
ports: ports:
- "8080:8080" - "8080:8080"
# depends_on: depends_on:
# postgres: postgres:
# condition: service_healthy condition: service_healthy
# redis: redis:
# condition: service_started condition: service_started
#
# postgres: postgres:
# container_name: panettone_postgres container_name: panettone_postgres
# build: build:
# context: ./db context: ./db
# dockerfile: Dockerfile dockerfile: Dockerfile
# volumes: volumes:
# - panettone_postgres_data:/var/lib/postgresql/data - panettone_postgres_data:/var/lib/postgresql/data
# env_file: env_file:
# - .env - .env
# ports: ports:
# - 5432:5432 - 5432:5432
# environment: environment:
# - POSTGRES_PASSWORD=${POSTGRES_PASSWORD?Variable not set} - POSTGRES_PASSWORD=${POSTGRES_PASSWORD?Variable not set}
# - POSTGRES_USER=${POSTGRES_USER?Variable not set} - POSTGRES_USER=${POSTGRES_USER?Variable not set}
# - POSTGRES_DB=${POSTGRES_DB?Variable not set} - POSTGRES_DB=${POSTGRES_DB?Variable not set}
# healthcheck: healthcheck:
# test: test:
# [ [
# "CMD-SHELL", "pg_isready -d $POSTGRES_DB -U $POSTGRES_USER" "CMD-SHELL", "pg_isready -d $POSTGRES_DB -U $POSTGRES_USER"
# ] ]
# interval: 5s interval: 5s
# timeout: 5s timeout: 5s
# retries: 5 retries: 5
#
# redis: redis:
# image: redis:latest image: redis:latest
# container_name: panettone_redis container_name: panettone_redis
# ports: ports:
# - "6379:6379" - "6379:6379"
# env_file: env_file:
# - .env - .env
# entrypoint: redis-server --appendonly yes entrypoint: redis-server --appendonly yes
#
#
#volumes: volumes:
# panettone_postgres_data: {} panettone_postgres_data: { }