-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
57 lines (42 loc) · 1.24 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
FROM python:3.12-slim
ARG DJANGO_SETTINGS_MODULE=config.settings.production
# Set environment variables
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
UV_LINK_MODE=copy \
UV_COMPILE_BYTECODE=1 \
UV_PYTHON_DOWNLOADS=never \
DJANGO_SETTINGS_MODULE=${DJANGO_SETTINGS_MODULE}
# Install uv
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
# Set working directory
WORKDIR /app
# Install required system packages
RUN apt-get update && \
apt-get install -y build-essential libpq-dev && \
rm -rf /var/lib/apt/lists/*
# Copy dependency files
COPY pyproject.toml uv.lock ./
# Install dependencies
RUN uv sync --frozen --no-install-project --no-editable --no-dev
# Copy the project
COPY . .
# Install the project
RUN uv sync --frozen --no-editable --no-dev
# Install playwright
RUN apt-get update && apt-get install -y --no-install-recommends \
libnss3 \
libxss1 \
libasound2 \
fonts-noto-color-emoji \
libxtst6
RUN uv run playwright install --with-deps
RUN chmod +x ./entrypoint.sh
# Install cron
RUN apt-get update && apt-get install -y cron
# Add crontab file
COPY crontab /etc/cron.d/app-cron
RUN chmod 0644 /etc/cron.d/app-cron
RUN crontab /etc/cron.d/app-cron
# Set the entrypoint
CMD ["./entrypoint.sh"]