Skip to content

Commit

Permalink
chore: docker-compose.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
WilliamSilveiraF committed Oct 28, 2023
1 parent f3bc392 commit f05b9f1
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 13 deletions.
2 changes: 1 addition & 1 deletion api/routes/audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

router = APIRouter()

AUDIO_PATH = "uploaded_audio/"
AUDIO_PATH = "/app/uploaded_audio/"

@router.post("/upload/")
async def upload_audio(
Expand Down
40 changes: 29 additions & 11 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,38 @@
version: '3.8'
version: '3.1'

services:
web:
build: .
image: audio-sentiment-analysis:latest
ports:
- "8000:80"
environment:
- DATABASE_URL=mysql+mysqlconnector://william:Al12N%23assr@sentimentAnalysis-mysql/sentimentAnalysis
- "8080:80"
depends_on:
- db

networks:
- mynet
volumes:
- uploaded_audio:/app/uploaded_audio
- ./gcp.json:/app/gcp.json
environment:
- GOOGLE_APPLICATION_CREDENTIALS=/app/gcp.json
db:
image: mysql:latest
image: postgres:16
container_name: sentimentanalysis-db
environment:
- MYSQL_ROOT_PASSWORD=Al12N%23assr
- MYSQL_DATABASE=sentimentAnalysis
- MYSQL_USER=root
- MYSQL_PASSWORD=Al12N%23assr
POSTGRES_DB: sentimentanalysis_db
POSTGRES_USER: william
POSTGRES_PASSWORD: password
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- mynet
restart: always

networks:
mynet:
driver: bridge

volumes:
postgres_data:
uploaded_audio:
4 changes: 3 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from fastapi import FastAPI
from api.routes import audio
from api.routes import audio # FIXME LOAD MODEL BEFORE INITIALIZATION
from middlewares import cors_middleware
import db

Expand All @@ -10,3 +10,5 @@
cors_middleware.setup_cors(app)

app.include_router(audio.router)


0 comments on commit f05b9f1

Please sign in to comment.