File size: 735 Bytes
1efe053 bebd6b9 1efe053 bebd6b9 1efe053 bebd6b9 |
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 |
# Use Python slim image for efficiency
FROM python:3.10-slim
# Set up environment variables
ENV PYTHONUNBUFFERED=1 \
PATH="/home/user/.local/bin:$PATH"
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
nodejs \
npm \
&& rm -rf /var/lib/apt/lists/*
# Install npm package
RUN npm install -g youtube-po-token-generator
# Create non-root user
RUN useradd -m -u 1000 user
USER user
WORKDIR /app
# Install Python dependencies
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir --user -r requirements.txt
# Copy application files
COPY --chown=user . .
# Expose port
EXPOSE 7860
# Run application
CMD ["python", "app.py"]
|