feat: dockerize dev env

This commit is contained in:
Felix Spöttel
2023-01-06 15:38:30 +01:00
parent b3a38846ba
commit c90915ba40
10 changed files with 144 additions and 26 deletions

55
dev.docker-compose.yml Normal file
View File

@@ -0,0 +1,55 @@
version: "3.8"
services:
app:
container_name: whisper_api_app
build:
context: .
dockerfile: dev.Dockerfile
environment:
DATABASE_URI: postgresql://postgres:postgres@postgres/whisper_api
ENVIRONMENT: development
API_SECRET: foobar
ports:
- "8000:80"
networks:
- app
volumes:
- ./:/code
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_started
postgres:
container_name: whisper_api_postgres
image: postgres:15-alpine
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: whisper_api
ports:
- "5432:5432"
networks:
- app
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
redis:
container_name: whisper_api_redis
image: redis:7-alpine
networks:
- app
volumes:
postgres-data:
networks:
app:
driver: bridge