Isaac Quarenta commited on
Commit ·
feca3d8
1
Parent(s): d1764d5
fix: Dockerfile - CMD usa bash direto, scripts copiados para /akira/scripts/
Browse files- Dockerfile +56 -60
Dockerfile
CHANGED
|
@@ -1,60 +1,56 @@
|
|
| 1 |
-
# Dockerfile — AKIRA V21 FastAPI + PostgreSQL
|
| 2 |
-
FROM python:3.11-slim
|
| 3 |
-
|
| 4 |
-
ENV DEBIAN_FRONTEND=noninteractive \
|
| 5 |
-
PYTHONUNBUFFERED=1 \
|
| 6 |
-
PYTHONDONTWRITEBYTECODE=1 \
|
| 7 |
-
PIP_NO_CACHE_DIR=1 \
|
| 8 |
-
PIP_DISABLE_PIP_VERSION_CHECK=1 \
|
| 9 |
-
LOCAL_LLM_AUTO_DOWNLOAD=true \
|
| 10 |
-
PGDATA=/data/pgdata \
|
| 11 |
-
PGHOST=localhost \
|
| 12 |
-
PGPORT=5432 \
|
| 13 |
-
PGDATABASE=akira \
|
| 14 |
-
PGUSER=akira \
|
| 15 |
-
PGPASSWORD=akira
|
| 16 |
-
|
| 17 |
-
WORKDIR /akira
|
| 18 |
-
|
| 19 |
-
RUN apt-get update && \
|
| 20 |
-
apt-get install -y --no-install-recommends \
|
| 21 |
-
bash \
|
| 22 |
-
postgresql \
|
| 23 |
-
postgresql-client \
|
| 24 |
-
curl \
|
| 25 |
-
ca-certificates \
|
| 26 |
-
tesseract-ocr \
|
| 27 |
-
tesseract-ocr-por \
|
| 28 |
-
tesseract-ocr-eng \
|
| 29 |
-
libgl1 \
|
| 30 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 31 |
-
|
| 32 |
-
RUN mkdir -p /akira/data /akira/data/cloud_sync /data/pgdata && chmod 755 /akira/data /data
|
| 33 |
-
|
| 34 |
-
COPY requirements.txt .
|
| 35 |
-
RUN pip install --upgrade pip && \
|
| 36 |
-
pip install --no-cache-dir --prefer-binary \
|
| 37 |
-
numpy \
|
| 38 |
-
huggingface_hub \
|
| 39 |
-
psycopg2-binary \
|
| 40 |
-
fastapi \
|
| 41 |
-
uvicorn[standard] \
|
| 42 |
-
-r requirements.txt
|
| 43 |
-
|
| 44 |
-
COPY
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
COPY scripts/
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
EXPOSE 7860
|
| 59 |
-
|
| 60 |
-
CMD ["/usr/local/bin/init_pg.sh"]
|
|
|
|
| 1 |
+
# Dockerfile — AKIRA V21 FastAPI + PostgreSQL
|
| 2 |
+
FROM python:3.11-slim
|
| 3 |
+
|
| 4 |
+
ENV DEBIAN_FRONTEND=noninteractive \
|
| 5 |
+
PYTHONUNBUFFERED=1 \
|
| 6 |
+
PYTHONDONTWRITEBYTECODE=1 \
|
| 7 |
+
PIP_NO_CACHE_DIR=1 \
|
| 8 |
+
PIP_DISABLE_PIP_VERSION_CHECK=1 \
|
| 9 |
+
LOCAL_LLM_AUTO_DOWNLOAD=true \
|
| 10 |
+
PGDATA=/data/pgdata \
|
| 11 |
+
PGHOST=localhost \
|
| 12 |
+
PGPORT=5432 \
|
| 13 |
+
PGDATABASE=akira \
|
| 14 |
+
PGUSER=akira \
|
| 15 |
+
PGPASSWORD=akira
|
| 16 |
+
|
| 17 |
+
WORKDIR /akira
|
| 18 |
+
|
| 19 |
+
RUN apt-get update && \
|
| 20 |
+
apt-get install -y --no-install-recommends \
|
| 21 |
+
bash \
|
| 22 |
+
postgresql \
|
| 23 |
+
postgresql-client \
|
| 24 |
+
curl \
|
| 25 |
+
ca-certificates \
|
| 26 |
+
tesseract-ocr \
|
| 27 |
+
tesseract-ocr-por \
|
| 28 |
+
tesseract-ocr-eng \
|
| 29 |
+
libgl1 \
|
| 30 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 31 |
+
|
| 32 |
+
RUN mkdir -p /akira/data /akira/data/cloud_sync /data/pgdata && chmod 755 /akira/data /data
|
| 33 |
+
|
| 34 |
+
COPY requirements.txt .
|
| 35 |
+
RUN pip install --upgrade pip && \
|
| 36 |
+
pip install --no-cache-dir --prefer-binary \
|
| 37 |
+
numpy \
|
| 38 |
+
huggingface_hub \
|
| 39 |
+
psycopg2-binary \
|
| 40 |
+
fastapi \
|
| 41 |
+
uvicorn[standard] \
|
| 42 |
+
-r requirements.txt
|
| 43 |
+
|
| 44 |
+
COPY main.py .
|
| 45 |
+
COPY treinamento_worker.py .
|
| 46 |
+
COPY modules/ modules/
|
| 47 |
+
COPY scripts/ scripts/
|
| 48 |
+
|
| 49 |
+
RUN chmod +x /akira/scripts/init_pg.sh /akira/scripts/pg_backup.sh 2>/dev/null || true
|
| 50 |
+
|
| 51 |
+
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
|
| 52 |
+
CMD curl -f http://localhost:7860/health || exit 1
|
| 53 |
+
|
| 54 |
+
EXPOSE 7860
|
| 55 |
+
|
| 56 |
+
CMD ["bash", "/akira/scripts/init_pg.sh"]
|
|
|
|
|
|
|
|
|
|
|
|