Skip to content

Commit

Permalink
[CHORE] 도커 올리기
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnyineverywhere committed Sep 3, 2023
1 parent 8967d47 commit dfc613d
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 12 deletions.
38 changes: 37 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
nginx:
image: nginx
ports:
- "80:8000"
- "80:80"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
depends_on:
Expand Down Expand Up @@ -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:
4 changes: 2 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
app = FastAPI()
app.add_middleware(
CORSMiddleware,
allow_origins=["http://localhost:3000"],
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
Expand Down Expand Up @@ -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)
15 changes: 6 additions & 9 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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' '*';
Expand Down

0 comments on commit dfc613d

Please sign in to comment.