owenkaplinsky commited on
Commit
0b87a40
·
verified ·
1 Parent(s): c3627b9

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -25
Dockerfile CHANGED
@@ -2,8 +2,8 @@ FROM python:3.12-slim
2
 
3
  WORKDIR /app
4
 
5
- # System dependencies
6
- RUN apt-get update && apt-get install -y gcc libpq-dev && rm -rf /var/lib/apt/lists/*
7
 
8
  # Copy requirement files
9
  COPY requirements/base.txt requirements/base.txt
@@ -34,28 +34,8 @@ COPY secrets/ /app/secrets/
34
  ENV PYTHONPATH=/app
35
  EXPOSE 7860
36
 
37
- # Create entry script inside the image (avoids missing file in build context)
38
- RUN printf '%s\n' \
39
- '#!/usr/bin/env bash' \
40
- 'set -e' \
41
- '' \
42
- '# Hugging Face provides PORT; default to 7860 locally' \
43
- 'export PORT=\"${PORT:-7860}\"' \
44
- '' \
45
- '# Defaults for local in-container routing; can be overridden via env' \
46
- 'export SUPERVISOR_API_URL=\"${SUPERVISOR_API_URL:-http://127.0.0.1:8080/api/v1/supervisor}\"' \
47
- 'export DATABASE_API_URL=\"${DATABASE_API_URL:-http://127.0.0.1:8080/api/v1/db}\"' \
48
- 'export CV_UPLOAD_API_URL=\"${CV_UPLOAD_API_URL:-http://127.0.0.1:8080/api/v1/cv}\"' \
49
- '' \
50
- '# Start FastAPI backend' \
51
- 'uvicorn src.api.app:app --host 0.0.0.0 --port 8080 &' \
52
- '' \
53
- '# Give the API a moment to come up' \
54
- 'sleep 2' \
55
- '' \
56
- '# Run Gradio frontend' \
57
- 'python src/frontend/gradio/app.py' \
58
- > /app/start.sh \
59
- && chmod +x /app/start.sh
60
 
61
  CMD ["/app/start.sh"]
 
2
 
3
  WORKDIR /app
4
 
5
+ # System dependencies (include Postgres server so DB can run in-container)
6
+ RUN apt-get update && apt-get install -y gcc libpq-dev postgresql postgresql-contrib gosu && rm -rf /var/lib/apt/lists/*
7
 
8
  # Copy requirement files
9
  COPY requirements/base.txt requirements/base.txt
 
34
  ENV PYTHONPATH=/app
35
  EXPOSE 7860
36
 
37
+ # Copy entry script (includes Postgres startup)
38
+ COPY start.sh /app/start.sh
39
+ RUN chmod +x /app/start.sh
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
 
41
  CMD ["/app/start.sh"]