Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion backend-agent/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,15 @@

# app = Flask(__name__)
app = create_app()
CORS(app)

# Configure CORS with allowed origins, if any
allowed_origins = os.getenv('ALLOWED_ORIGINS', '').split(',')
# Configure CORS
if allowed_origins:
CORS(app, resources={r"/*": {"origins": allowed_origins}})
else:
CORS(app)

sock = Sock(app)

# Langfuse can be used to analyze tracings and help in debugging.
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
context: ./frontend
dockerfile: Dockerfile
ports:
- "8000:80"
- "3000:8080"
depends_on:
- backend
networks:
Expand All @@ -28,4 +28,4 @@ networks:
driver: bridge

volumes:
stars-backend-db:
stars-backend-db:
3 changes: 2 additions & 1 deletion docs/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ To run the agent application (frontend and backend) using Docker, just run
docker compose up
```

The frontend will be available at `http://localhost:3000`.

## Docker Troubleshooting

Expand All @@ -31,7 +32,7 @@ If the frontend is not able to communicate with the backend (and you can see
the red error message in the browser `No connection to Agent. Make sure the
agent is reachable and refresh this page.`), first try to refresh the page,
then, if the error persists, follow the steps in `/frontend` to rebuild the
frontend and re-launch the Docker containers.
frontend with `ng build --configuration docker` and re-launch the Docker containers.

Alternatively, review the configuration and the chosen backend endpoint (and
consider a local test run using `localhost`).
2 changes: 2 additions & 0 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ launch.json
/node_modules

# config
src/assets/configs/config.json
src/environments/environment.ts
src/environments/environment.k8s.ts

# System Files
.DS_Store
Expand Down
10 changes: 10 additions & 0 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM nginxinc/nginx-unprivileged

# Use default Nginx config (listens on port 8080)
COPY ./nginx.conf /etc/nginx/conf.d/default.conf

COPY ./dist/stars /usr/share/nginx/html
COPY ./src/assets/configs/config.local.json /usr/share/nginx/html/assets/configs/config.json

EXPOSE 8080
CMD ["nginx", "-g", "daemon off;"]
5 changes: 0 additions & 5 deletions frontend/src/environments/environment.k8s.ts

This file was deleted.

Loading