This commit is contained in:
pika 2025-03-24 19:30:00 +01:00
parent b834040b4e
commit 6e9cea9ba4
2 changed files with 106 additions and 152 deletions

View file

@ -1,16 +1,30 @@
FROM python:3.12-alpine
# Create app directory
WORKDIR /app
COPY requirements.txt /app/
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1
# Install dependencies first (for better caching)
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . /app/
# Copy the rest of the application
COPY . .
# Make entrypoint script executable
RUN chmod +x /app/entrypoint.sh
# Make the entrypoint script executable
RUN chmod +x entrypoint.sh
EXPOSE 5000
# Set correct permissions
RUN chown -R nobody:nobody /app
# Switch to non-root user
USER nobody
# Set proper signal handling for faster shutdown
ENTRYPOINT ["/app/entrypoint.sh"]
CMD ["server"]