Skip to content

Commit

Permalink
improve existing docker compose workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Echomo-Xinyu committed Nov 13, 2024
1 parent 14c4131 commit 9c268b4
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
4 changes: 2 additions & 2 deletions backend/ai-hint-service/app/.env.sample
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
OPENAI_API_KEY="API_KEY"
QUESTION_SERVICE_URL = "http://question:3002"
OPENAI_API_KEY="sk-proj-API_KEY"
QUESTION_SERVICE_URL=http://question:3002
9 changes: 7 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ services:

rabbitmq:
image: dedsecrattle/rabbitmq-delayed-exchange
restart: always
ports:
- "5672:5672" # RabbitMQ message broker
- "15672:15672" # RabbitMQ management plugin
Expand Down Expand Up @@ -132,15 +133,19 @@ services:
- "3006:8000"
depends_on:
- question # Assuming 'question' service is needed to fetch question descriptions
environment:
- OPENAI_API_KEY=sk-proj-<> # Add your own OpenAI API key
- QUESTION_SERVICE_URL=http://question:3002

frontend:
image: echomo/cs3219-frontend
build: ./frontend
environment:
- REACT_APP_USER_SERVICE_URL=http://localhost:3001/
- REACT_APP_QUESTION_SERVICE_URL=http://localhost:3002/
- REACT_APP_MATCHING_SERVICE_URL=http://localhost:3003
- REACT_APP_COMMUNICATION_SERVICE_URL=http://localhost:3004
- REACT_APP_COLLABORATION_SERVICE_URL=http://localhost:3005
- REACT_APP_AI_HINT_URL=http://localhost:3006
- REACT_APP_VIDEO_SERVICE_PORT=9000
ports:
- "80:80"
Expand All @@ -151,4 +156,4 @@ services:
- question
- collaboration
- rabbitmq
- ai-hint-service # Ensure frontend waits for ai-hint-service
- ai-hint-service
2 changes: 1 addition & 1 deletion frontend/.env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# REACT_APP_VIDEO_SERVICE_PORT=9000

# In docker
REACT_APP_QUESTION_SERVICE_URL=http://localhost:3002/
REACT_APP_USER_SERVICE_URL=http://localhost:3001/
REACT_APP_QUESTION_SERVICE_URL=http://localhost:3002/
REACT_APP_MATCHING_SERVICE_URL=http://localhost:3003
REACT_APP_COMMUNICATION_SERVICE_URL=http://localhost:3004
REACT_APP_COLLABORATION_SERVICE_URL=http://localhost:3005
Expand Down
2 changes: 2 additions & 0 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ ARG REACT_APP_QUESTION_SERVICE_URL=http://localhost:3002/
ARG REACT_APP_MATCHING_SERVICE_URL=http://localhost:3003
ARG REACT_APP_COMMUNICATION_SERVICE_URL=http://localhost:3004
ARG REACT_APP_COLLABORATION_SERVICE_URL=http://localhost:3005
ARG REACT_APP_AI_HINT_URL=http://localhost:3006
ARG REACT_APP_VIDEO_SERVICE_PORT=9000

ENV REACT_APP_USER_SERVICE_URL=$REACT_APP_USER_SERVICE_URL
ENV REACT_APP_QUESTION_SERVICE_URL=$REACT_APP_QUESTION_SERVICE_URL
ENV REACT_APP_MATCHING_SERVICE_URL=$REACT_APP_MATCHING_SERVICE_URL
ENV REACT_APP_COMMUNICATION_SERVICE_URL=$REACT_APP_COMMUNICATION_SERVICE_URL
ENV REACT_APP_COLLABORATION_SERVICE_URL=$REACT_APP_COLLABORATION_SERVICE_URL
ENV REACT_APP_AI_HINT_URL=$REACT_APP_AI_HINT_URL
ENV REACT_APP_VIDEO_SERVICE_PORT=$REACT_APP_VIDEO_SERVICE_PORT


Expand Down

0 comments on commit 9c268b4

Please sign in to comment.