-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
45 lines (35 loc) · 1.08 KB
/
Copy pathDockerfile
File metadata and controls
45 lines (35 loc) · 1.08 KB
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
# Use Python 3.11 slim image
FROM python:3.11-slim
# Set environment variables
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
UV_SYSTEM_PYTHON=1 \
DATABASE_TYPE=sqlite \
DEBUG=False \
ALLOWED_HOSTS=*
# Install system dependencies including fonts for OG image generation
RUN apt-get update && apt-get install -y \
curl \
git \
cron \
fonts-liberation \
fonts-dejavu-core \
&& rm -rf /var/lib/apt/lists/*
# Install uv
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
ENV PATH="/root/.local/bin:${PATH}"
# Set work directory
WORKDIR /app
# Copy project files first
COPY . .
# Install Python dependencies using uv
RUN uv pip install --system -e .
# Create directory for static files
RUN mkdir -p /app/staticfiles
# Expose port
EXPOSE 8000
# Run entrypoint script
COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["sh", "-c", "gunicorn --bind 0.0.0.0:${PORT:-8000} --workers 3 --timeout 120 --access-logfile - --error-logfile - --log-level info blik.wsgi:application"]