-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdockerfile
More file actions
32 lines (23 loc) · 831 Bytes
/
dockerfile
File metadata and controls
32 lines (23 loc) · 831 Bytes
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
FROM python:3.14-slim
WORKDIR /app
# Install system dependencies for potential build requirements
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
libpq-dev \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.lock.txt .
RUN pip install --no-cache-dir --require-hashes -r requirements.lock.txt
# Copy the application code
COPY app/ ./app/
COPY config.py .
COPY run.py .
# Create the database directory for SQLite fallback
RUN mkdir -p db
EXPOSE 5000
ENV BASE_DOMAIN=short.example.com
ENV EXPIRY_HOURS=24
ENV SHORT_CODE_LENGTH=6
ENV DEFAULT_QR_COLOR="black"
ENV DEFAULT_QR_BACKGROUND="white"
# Use the entry point with gunicorn
CMD ["gunicorn", "--bind", "0.0.0.0:5000", "app:create_app()", "--workers", "4", "--threads", "2", "--preload", "--access-logfile", "-", "--error-logfile", "-"]