HairFastGANendpoint / docker-compose.yml
jefrisuparjanaAI's picture
Create docker-compose.yml
14b95c9 verified
version: '3.8'
services:
# gRPC Inference Server
inference-server:
build:
context: .
dockerfile: Dockerfile
container_name: hairfast-inference
command: python inference_server.py
ports:
- "50051:50051"
volumes:
- ./models:/app/models
- ./input:/app/input
- ./output:/app/output
environment:
- PYTHONUNBUFFERED=1
networks:
- hairfast-network
restart: unless-stopped
# Flask API Server
api-server:
build:
context: .
dockerfile: Dockerfile
container_name: hairfast-api
command: python api_server.py
ports:
- "5000:5000"
volumes:
- ./models:/app/models
- ./input:/app/input
- ./output:/app/output
environment:
- SERVER=inference-server:50051
- PORT=5000
- PYTHONUNBUFFERED=1
depends_on:
- inference-server
networks:
- hairfast-network
restart: unless-stopped
# Gradio Web Interface (optional)
gradio-app:
build:
context: .
dockerfile: Dockerfile
container_name: hairfast-gradio
command: python app.py
ports:
- "7860:7860"
volumes:
- ./models:/app/models
- ./input:/app/input
- ./output:/app/output
environment:
- SERVER=inference-server:50051
- PYTHONUNBUFFERED=1
depends_on:
- inference-server
networks:
- hairfast-network
restart: unless-stopped
# Nginx (optional - untuk serve test.html dan reverse proxy)
nginx:
image: nginx:alpine
container_name: hairfast-nginx
ports:
- "80:80"
volumes:
- ./test.html:/usr/share/nginx/html/index.html
- ./nginx.conf:/etc/nginx/conf.d/default.conf
depends_on:
- api-server
networks:
- hairfast-network
restart: unless-stopped
networks:
hairfast-network:
driver: bridge
volumes:
models:
input:
output: