Files
minerops/compose.dev.yaml
T

107 lines
2.1 KiB
YAML

name: minerops-dev
services:
postgres:
image: postgres:16-alpine
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
- postgres-dev:/var/lib/postgresql/data
networks:
- dev
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 5s
timeout: 5s
retries: 12
redis:
image: redis:7-alpine
command: ["redis-server", "--appendonly", "yes"]
volumes:
- redis-dev:/data
networks:
- dev
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 12
backend:
build:
context: .
dockerfile: backend/Dockerfile
env_file:
- .env.dev
command:
- /bin/sh
- -ec
- alembic upgrade head && exec uvicorn app.main:app --host 0.0.0.0 --port 8000
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
networks:
- dev
read_only: true
tmpfs:
- /tmp
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
healthcheck:
test:
- CMD
- python
- -c
- "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/api/health', timeout=3)"
interval: 10s
timeout: 5s
retries: 12
start_period: 20s
gateway:
image: nginx:1.29-alpine
depends_on:
backend:
condition: service_healthy
ports:
- "${MINEROPS_DEV_PORT:-18000}:8080"
networks:
- dev
- edge
volumes:
- ./dev/nginx.conf:/etc/nginx/nginx.conf:ro
read_only: true
tmpfs:
- /tmp
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
user: "101:101"
healthcheck:
test:
- CMD
- wget
- --quiet
- --spider
- http://127.0.0.1:8080/api/health
interval: 10s
timeout: 5s
retries: 12
networks:
dev:
internal: true
edge:
volumes:
postgres-dev:
redis-dev: