Files
kami_apple_exchage/backend/Dockerfile.worker
danial 48cdcb6140 feat: Add deployment scripts and configuration for Apple Gift Card Exchange Platform
- Create README.md for deployment instructions including environment requirements and setup steps.
- Implement deploy.sh script for automated deployment of development and production environments.
- Add combined Docker Compose configuration for frontend and backend services.
- Include Redis configuration file for optimized memory management and persistence.
- Update frontend Dockerfile to handle Next.js asset paths and static files.
- Remove obsolete deployment files and configurations from frontend directory.
2025-09-11 17:57:18 +08:00

41 lines
1.1 KiB
Docker

FROM mcr.microsoft.com/playwright/python:v1.55.0-jammy
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
ENV DEBIAN_FRONTEND=noninteractive \
UV_COMPILE_BYTECODE=1 \
PATH="/app/.venv/bin:$PATH" \
UV_LINK_MODE=copy \
TZ=Asia/Shanghai \
PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PLAYWRIGHT_BROWSERS_PATH=/app/playwright-browsers
WORKDIR /app
RUN apt-get update && apt-get install -y \
gcc g++ curl wget gnupg \
&& rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get autoremove -y
COPY pyproject.toml uv.lock ./
COPY --chmod=755 docker-entrypoint.sh ./
RUN uv sync --frozen && \
chmod -R 755 /app/.venv/bin/*
RUN mkdir -p /app/screenshots /app/logs /app/data /app/playwright-browsers
COPY app ./app
COPY .env.production .env
COPY test_gunicorn.py ./
COPY run.py ./
RUN python -m playwright install chromium && \
python -m playwright install-deps chromium
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
CMD python -c "from app.core.celery_app import get_celery_app; app = get_celery_app(); print('Worker healthy')" || exit 1
EXPOSE 8000
ENTRYPOINT ["./docker-entrypoint.sh"]