Some checks failed
Build and Deploy / build-and-deploy (push) Has been cancelled
Split from coop monolith. Includes: - Market/browse/product blueprints - Product sync API - Suma scraping pipeline - Templates for market, browse, and product views - Dockerfile and CI workflow for independent deployment
34 lines
792 B
Docker
34 lines
792 B
Docker
# syntax=docker/dockerfile:1
|
|
|
|
# ---------- Python application ----------
|
|
FROM python:3.11-slim AS base
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1 \
|
|
PYTHONUNBUFFERED=1 \
|
|
PIP_NO_CACHE_DIR=1 \
|
|
APP_PORT=8000 \
|
|
APP_MODULE=app:app
|
|
|
|
WORKDIR /app
|
|
|
|
# Install system deps + psql client
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
ca-certificates \
|
|
postgresql-client \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY requirements.txt ./requirements.txt
|
|
RUN pip install -r requirements.txt
|
|
|
|
COPY . .
|
|
|
|
# ---------- Runtime setup ----------
|
|
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
|
|
RUN chmod +x /usr/local/bin/entrypoint.sh
|
|
|
|
RUN useradd -m -u 10001 appuser && chown -R appuser:appuser /app
|
|
USER appuser
|
|
|
|
EXPOSE ${APP_PORT}
|
|
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|