Skip to content

Commit

Permalink
Changes port to 8241/8242
Browse files Browse the repository at this point in the history
  • Loading branch information
elijahbenizzy committed Apr 24, 2024
1 parent 6a7a4e5 commit d4a0432
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 25 deletions.
12 changes: 2 additions & 10 deletions docs/concepts/ui.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,9 @@ This will do the following:
3. Start the backend server
4. Start the frontend server

This takes a bit of time! So be patient. The server will be running on port 3000 -- in the logs you'll see something like this:
This takes a bit of time! So be patient. The server will be running on port 8242 -- in the logs you'll see something like this:

.. code-block:: bash
2024-04-18 15:57:07 You can now view frontend in the browser.
2024-04-18 15:57:07
2024-04-18 15:57:07 Local: http://localhost:3000
2024-04-18 15:57:07 On Your Network: http://172.19.0.4:3000
Then navigate to ``http://localhost:3000`` in your browser, and enter your email (this will be the username used within the app).
Then navigate to ``http://localhost:8242`` in your browser, and enter your email (this will be the username used within the app).

Building the Docker Images locally
__________________________________
Expand Down
2 changes: 1 addition & 1 deletion ui/backend/server/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set -e

python manage.py migrate # Apply database migrations
python manage.py runserver 0.0.0.0:8000 # Start the server
python manage.py runserver 0.0.0.0:8241 # Start the server
1 change: 1 addition & 0 deletions ui/backend/server/server/default_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ def root_index(request) -> HttpResponse:
<header></header>
<body>
<h1><center>Welcome to the backend server!</center></h1>
<p><center>Did you mean to visit the <a href="http://localhost:8242">frontend</a>? Note this sometimes takes a bit of time to start up.</center> </p>
</body>
</html>
"""
Expand Down
4 changes: 3 additions & 1 deletion ui/deployment/Dockerfile.frontend
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ ENV NODE_OPTIONS="--max-old-space-size=8192"

RUN npm run build

EXPOSE 3000
EXPOSE 8242

ENV PORT=8242

CMD ["npm", "run", "start"]
4 changes: 2 additions & 2 deletions ui/deployment/Dockerfile.frontend-prod
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ FROM nginx:stable-alpine as production-stage
COPY --from=build-stage /usr/src/app/build /usr/share/nginx/html

# Expose port 80 to the outside once the container has launched
EXPOSE 3000
EXPOSE 8242

# Use the default nginx.conf provided by tiangolo/nginx-rtmp
COPY ./deployment/nginx/nginx.conf /etc/nginx/nginx.conf

CMD ["echo", "Frontend running on port 3000, go to http://localhost:3000 to view the app."]
CMD ["echo", "Frontend running on port 8242, go to http://localhost:8242 to view the app."]

# Start Nginx and keep the process from backgrounding and the container from quitting
CMD ["nginx", "-g", "daemon off;"]
4 changes: 2 additions & 2 deletions ui/deployment/docker-compose-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ services:
dockerfile: deployment/Dockerfile.backend-prod
entrypoint: ["/bin/bash", "-c", "cd /code/server && ls && ./entrypoint.sh"]
ports:
- "8000:8000"
- "8241:8241"
environment:
- DB_HOST=db
- DB_PORT=5432
Expand All @@ -49,7 +49,7 @@ services:
- REACT_APP_AUTH_MODE=local
- REACT_APP_USE_POSTHOG=false
ports:
- "3000:3000"
- "8242:8242"
environment:
- NODE_ENV=development
- REACT_APP_AUTH_MODE=local
Expand Down
6 changes: 3 additions & 3 deletions ui/deployment/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ services:
- ./backend:/code
- backend_data:/data/
ports:
- "8000:8000"
- "8241:8241"
environment:
- DB_HOST=db
- DB_PORT=5432
Expand All @@ -52,12 +52,12 @@ services:
- ./frontend:/usr/src/app
- /usr/src/app/node_modules
ports:
- "3000:3000"
- "8242:8242"
environment:
- NODE_ENV=development
- REACT_APP_AUTH_MODE=local
- REACT_APP_USE_POSTHOG=false
- REACT_APP_API_URL=http://backend:8000
- REACT_APP_API_URL=http://backend:8241
depends_on:
- backend

Expand Down
6 changes: 3 additions & 3 deletions ui/deployment/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ http {
default_type application/octet-stream;

server {
listen 3000;
listen 8242;
server_name localhost;

root /usr/share/nginx/html; # Common root for all files.
Expand All @@ -23,7 +23,7 @@ http {

# Proxy /api requests to backend
location /api {
proxy_pass http://backend:8000; # Assuming the API server is on the same host
proxy_pass http://backend:8241;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
Expand All @@ -32,7 +32,7 @@ http {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 5000; # Timeout setting as per your node configuration
proxy_read_timeout 5000;
}
}
}
2 changes: 1 addition & 1 deletion ui/frontend/.env.local
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
REACT_APP_API_URL=localhost:8000
REACT_APP_API_URL=localhost:8241
REACT_APP_USE_POSTHOG=false
REACT_APP_AUTH_MODE=local
4 changes: 2 additions & 2 deletions ui/sdk/src/hamilton_sdk/api/constants.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
HAMILTON_API_URL = "http://localhost:8000"
HAMILTON_UI_URL = "http://localhost:3000"
HAMILTON_API_URL = "http://localhost:8241"
HAMILTON_UI_URL = "http://localhost:8242"

0 comments on commit d4a0432

Please sign in to comment.