diff --git a/docker-compose.yml b/docker-compose.yml index 4a42480..2d93f07 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,7 +4,7 @@ services: nginx: image: nginx ports: - - "80:8000" + - "80:80" volumes: - ./nginx.conf:/etc/nginx/nginx.conf depends_on: @@ -37,5 +37,41 @@ services: networks: - my_network + fastapi3: + build: + context: . + dockerfile: Dockerfile + args: + - LIBGL_PATH=/usr/lib/x86_64-linux-gnu/libGL.so.1 + ports: + - "8003:8000" + + networks: + - my_network + + fastapi4: + build: + context: . + dockerfile: Dockerfile + args: + - LIBGL_PATH=/usr/lib/x86_64-linux-gnu/libGL.so.1 + ports: + - "8004:8000" + + networks: + - my_network + + fastapi5: + build: + context: . + dockerfile: Dockerfile + args: + - LIBGL_PATH=/usr/lib/x86_64-linux-gnu/libGL.so.1 + ports: + - "8005:8000" + + networks: + - my_network + networks: my_network: \ No newline at end of file diff --git a/main.py b/main.py index e29b128..f3be335 100644 --- a/main.py +++ b/main.py @@ -12,7 +12,7 @@ app = FastAPI() app.add_middleware( CORSMiddleware, - allow_origins=["http://localhost:3000"], + allow_origins=["*"], allow_credentials=True, allow_methods=["*"], allow_headers=["*"], @@ -116,6 +116,6 @@ async def answer_interview_additional(req: AdditionalInterviewReq, Authorization } -@app.get("/interview") +@app.get("/interview/all/{id}") async def get_interviw_question_by_pk(id: int, db: Session = Depends(get_db)): return crud.find_interview_question_by_pk(db=db, iq_id=id) diff --git a/nginx.conf b/nginx.conf index 0f25a80..8bbf39f 100644 --- a/nginx.conf +++ b/nginx.conf @@ -7,20 +7,17 @@ events { } http { - client_body_buffer_size 10m; - sendfile on; - tcp_nodelay on; - keepalive_timeout 65; - keepalive_requests 100; - include /etc/nginx/mime.types; - default_type application/octet-stream; + include /etc/nginx/mime.types; upstream fastapi { server fastapi1:8000; server fastapi2:8000; + server fastapi3:8000; + server fastapi4:8000; + server fastapi5:8000; } server { - listen 8000; - server_name qcard.co.kr; + listen 80; + server_name ec2-13-209-15-182.ap-northeast-2.compute.amazonaws.com; location / { proxy_hide_header Access-Control-Allow-Origin; add_header 'Access-Control-Allow-Origin' '*';