fix: dedicated scheduler Dockerfile with psql for migrations, remove Python splitter

This commit is contained in:
Celes Renata
2026-04-19 23:35:00 +00:00
parent 48fed18078
commit 0f2f0460a6
4 changed files with 43 additions and 4 deletions
+31
View File
@@ -0,0 +1,31 @@
# Scheduler image — adds postgresql-client for running migrations via psql.
# Built separately from the base service image. Only the scheduler uses this.
FROM registry.celestium.life/dockerhub-cache/library/python:3.12-slim
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV PYTHONPATH=/app
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
libpq-dev \
curl \
postgresql-client \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY services/ /app/services/
COPY tests/ /app/tests/
COPY conftest.py /app/conftest.py
COPY infra/migrations/ /app/infra/migrations/
RUN useradd -m -u 1000 stonks && \
chown -R stonks:stonks /app
USER stonks
CMD ["python", "-m", "services.scheduler.app"]