File size: 817 Bytes
a9f1355
 
 
dc55eb6
 
 
 
a9f1355
 
 
dc55eb6
a9f1355
 
 
 
ca84d15
 
 
a9f1355
 
 
55d0ad5
a9f1355
55d0ad5
a9f1355
dc55eb6
 
 
3cf19a4
a9f1355
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
# 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"]