FROM python:3.12-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt && useradd --uid 10001 --create-home shortlinks && mkdir /data && chown shortlinks /data
COPY app.py run.py ./
COPY templates ./templates
COPY static ./static
USER shortlinks
ENV SHORTLINK_DATA=/data
EXPOSE 8896
CMD ["python", "run.py", "--host", "0.0.0.0", "--port", "8896"]
