File size: 910 Bytes
2756f0f
 
 
 
 
 
 
 
 
 
 
 
 
4b1e064
 
2756f0f
 
 
 
 
 
4598c11
 
 
4b1e064
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Build from the repository root (the AI coach package lives next to the backend):
#   docker build -f backend/Dockerfile -t cognivision-backend .
FROM python:3.11-slim

ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1 PIP_NO_CACHE_DIR=1
WORKDIR /srv

COPY AI-coach-agent /opt/ai-coach-agent
RUN pip install /opt/ai-coach-agent

COPY backend/pyproject.toml backend/alembic.ini ./
COPY backend/app ./app
COPY backend/migrations ./migrations
RUN pip install . "google-auth[requests]>=2.30"
COPY backend/start-backend.sh /srv/start-backend.sh

RUN useradd --uid 1000 --create-home app
USER app
EXPOSE 8000

# Migrations run as a separate release step: docker run ... alembic upgrade head
# Behind a proxy, set FORWARDED_ALLOW_IPS to the proxy's address only (never "*"), or clients can spoof their IP
# and get around the per-IP login limits.
ENV FORWARDED_ALLOW_IPS=127.0.0.1
CMD ["sh", "/srv/start-backend.sh"]