feat: add project fork async job service with cli prune/clear commands and shared container image build target
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
# ppy: the single shared image every DevPlace container instance runs.
|
||||
# Build once with `make ppy`. Context is devplacepy/services/containers/files.
|
||||
FROM python:3.13-slim-bookworm AS base
|
||||
|
||||
ENV PYTHONUNBUFFERED=1 \
|
||||
PYTHONDONTWRITEBYTECODE=1 \
|
||||
PIP_NO_CACHE_DIR=1 \
|
||||
PIP_DISABLE_PIP_VERSION_CHECK=1 \
|
||||
DEBIAN_FRONTEND=noninteractive \
|
||||
PLAYWRIGHT_BROWSERS_PATH=/opt/playwright
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
git curl wget vim ack ca-certificates build-essential libpq-dev \
|
||||
tmux apache2-utils procps htop iftop iotop netcat-openbsd \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
FROM base AS deps
|
||||
RUN pip install \
|
||||
pip setuptools wheel packaging \
|
||||
requests urllib3 certifi idna charset-normalizer httpx aiohttp \
|
||||
pydantic typing-extensions python-dotenv aiofiles \
|
||||
python-dateutil six pytz \
|
||||
pyyaml toml \
|
||||
loguru structlog tenacity rich tqdm click typer
|
||||
RUN pip install \
|
||||
numpy pandas matplotlib plotly \
|
||||
sqlalchemy psycopg2-binary redis dataset
|
||||
RUN pip install \
|
||||
flask django fastapi starlette "uvicorn[standard]" gunicorn \
|
||||
celery apscheduler watchfiles \
|
||||
websocket-client websockets \
|
||||
beautifulsoup4 lxml scrapy
|
||||
RUN pip install \
|
||||
cryptography pycryptodome pillow \
|
||||
pytest ruff black isort flake8 mypy \
|
||||
sphinx mkdocs poetry pipenv hatch \
|
||||
reflex
|
||||
RUN pip install playwright && playwright install --with-deps chromium
|
||||
|
||||
FROM deps AS runtime
|
||||
COPY sudo /usr/local/bin/sudo
|
||||
COPY pagent /usr/bin/pagent.py
|
||||
COPY .vimrc /home/pravda/.vimrc
|
||||
RUN set -eu; \
|
||||
chmod 0755 /usr/local/bin/sudo /usr/bin/pagent.py; \
|
||||
ln -sf /usr/local/bin/sudo /usr/bin/sudo || true; \
|
||||
if getent passwd 1000 >/dev/null 2>&1; then \
|
||||
existing="$(getent passwd 1000 | cut -d: -f1)"; \
|
||||
if [ "$existing" != "pravda" ]; then userdel "$existing" 2>/dev/null || deluser "$existing" 2>/dev/null || true; fi; \
|
||||
fi; \
|
||||
if ! getent group pravda >/dev/null 2>&1; then groupadd --gid 1000 pravda 2>/dev/null || addgroup -g 1000 pravda 2>/dev/null || true; fi; \
|
||||
if ! id pravda >/dev/null 2>&1; then \
|
||||
useradd --uid 1000 --gid 1000 --create-home --shell /bin/bash pravda 2>/dev/null \
|
||||
|| adduser -u 1000 -G pravda -D -s /bin/sh pravda 2>/dev/null || true; \
|
||||
fi; \
|
||||
mkdir -p /app /home/pravda/.local/bin; \
|
||||
for d in /app /home/pravda /usr/local/lib /usr/local/bin /usr/local/share /usr/lib/python3 /opt; do \
|
||||
[ -e "$d" ] && chown -R pravda:pravda "$d" 2>/dev/null || true; \
|
||||
done
|
||||
|
||||
USER pravda
|
||||
ENV PATH=/home/pravda/.local/bin:$PATH
|
||||
WORKDIR /app
|
||||
CMD ["sleep", "infinity"]
|
||||
Reference in New Issue
Block a user