Skip to content

Commit 45a1694

Browse files
fix(pii): hardcode port 5001 (drop $PORT indirection)
EXPOSE can't be parameterized, so the configurable-PORT approach left EXPOSE showing 5001 regardless (Greptile P2). We own both the image and the taskdef and only ever need 5001, so hardcode it: exec-form CMD on 5001, EXPOSE 5001, healthcheck on 5001. Runtime cmdline is identical to the verified ${PORT} default (uvicorn ... --port 5001).
1 parent 52c2561 commit 45a1694

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

docker/pii.Dockerfile

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,13 @@ RUN groupadd -g 1001 pii && \
3838
chown -R pii:pii /app
3939
USER pii
4040

41-
# Bind a configurable port via $PORT. In the ECS task all containers share one
42-
# network namespace (awsvpc), so this must NOT collide with the app on 3000 —
43-
# default to 5001 and let the taskdef override via PORT.
44-
ENV PORT=5001
41+
# Listen on 5001. In the ECS task all containers share one network namespace
42+
# (awsvpc) and the app owns 3000, so this sidecar must not use 3000.
4543
EXPOSE 5001
4644

4745
# start-period is generous: five large spaCy models load at import before
4846
# /health responds. Tune against measured cold-start once built.
4947
HEALTHCHECK --interval=30s --timeout=5s --start-period=180s --retries=3 \
50-
CMD curl -fsS "http://localhost:${PORT}/health" || exit 1
48+
CMD curl -fsS http://localhost:5001/health || exit 1
5149

52-
CMD ["sh", "-c", "exec uvicorn server:app --host 0.0.0.0 --port ${PORT}"]
50+
CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "5001"]

0 commit comments

Comments
 (0)