generated from CS3219-AY2324S1/course-assessment-template
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker: Refactor #26
Merged
nicole-luo-exe
merged 13 commits into
bnjmnt4n/collaboration-service/stream-openai-response
from
bnjmnt4n/docker-tweaks
Nov 14, 2023
Merged
Docker: Refactor #26
nicole-luo-exe
merged 13 commits into
bnjmnt4n/collaboration-service/stream-openai-response
from
bnjmnt4n/docker-tweaks
Nov 14, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…y the server is used
…v` to customize settings
bnjmnt4n
commented
Nov 14, 2023
Comment on lines
1
to
+4
const QUESTIONS_URI = | ||
process.env.QUESTION_SERVICE_URI || | ||
process.env.NEXT_PUBLIC_QUESTION_SERVICE_URI || | ||
"http://localhost:3001"; | ||
process.env.NEXT_PUBLIC_QUESTION_SERVICE_URI || "http://localhost:3001"; | ||
const PRIVATE_QUESTIONS_URI = | ||
process.env.QUESTION_SERVICE_URI || "http://localhost:3001"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are 2 ways that the question service is being accessed via the frontend:
- Via the user's browser, so the question service URI must be publicly accessible
- From the container that the frontend service is currently running on (when performing server-side render on the code room page). A separate URI is needed here because the URI which is publicly accessible for users might not be accessible on the frontend container (eg. when running on Docker,
http://localhost:3001
is not accessible within the frontend container, buthttp://question-service:3001
is).
nicole-luo-exe
merged commit Nov 14, 2023
756683b
into
bnjmnt4n/collaboration-service/stream-openai-response
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR refactors the Docker compose setup:
.env
by adding to.dockerignore
and also only runningdotenv
in dev mode (I think this is what caused the issue running Docker on my computer just now).docker-compose.yml
to customize the values when building the image, instead of having to manually edit the frontend Dockerfile.docker-compose.yml
file is updated to use environment variables from.env
, so editing those environment variables will update the environment variables of all containersSummary
To use the
docker-compose.yml
to create containers for all services, simply create.env
in the root directory based on.env.template
, and rundocker-compose up --build --detach
.Otherwise, to run each service individually, you can manually create
.env
files in each directory like before.