Skip to content
Open
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
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM python:3.12-slim

WORKDIR /app

RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libpq-dev && \
rm -rf /var/lib/apt/lists/*

COPY pyproject.toml .
COPY src/ src/

RUN pip install --no-cache-dir .

ENV WELLCODE_DATA_DIR=/data

EXPOSE 8787

CMD ["wellcode", "serve", "--host", "0.0.0.0", "--port", "8787"]
Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The container entrypoint starts the FastAPI server with wellcode serve --host 0.0.0.0 --port 8787, while the metrics and survey APIs are currently unauthenticated and served with very permissive CORS. When this image is run with a published port (e.g. via docker-compose), any host on the network can query detailed engineering metrics and survey data without authorization. Restrict the default bind address (or require an explicit host for non-local use) and/or add an authentication layer in the API so that exposing this container on 0.0.0.0 does not leak internal metrics by default.

Suggested change
CMD ["wellcode", "serve", "--host", "0.0.0.0", "--port", "8787"]
CMD ["sh", "-c", "wellcode serve --host ${WELLCODE_HOST:-127.0.0.1} --port ${WELLCODE_PORT:-8787}"]

Copilot uses AI. Check for mistakes.
Loading
Loading