Boh / Dockerfile
LoremPizza's picture
Update Dockerfile
ca84d15 verified
raw
history blame contribute delete
817 Bytes
# Use an official Python runtime as a parent image
FROM python:3.9-slim
# Create a new user with UID 1000
RUN useradd -m -u 1000 appuser
# Set the working directory to /app
WORKDIR /app
# Copy the current directory contents into the container at /app
COPY --chown=appuser:appuser . /app
# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# Ensure the extracted directory exists and has correct permissions
RUN mkdir -p /app/extracted && chown appuser:appuser /app/extracted
# Make port 8080 available to the world outside this container
EXPOSE 8080
# Set environment variables
ENV FLASK_RUN_HOST=0.0.0.0
ENV FLASK_APP=wltv_server.py
# Switch to the non-root user
USER appuser
# Run the Flask app on port 8080
CMD ["flask", "run", "--port", "8080"]