2024-09-04 15:15:40 -07:00
|
|
|
# Use an official Python runtime as a parent image
|
|
|
|
FROM python:3.10-slim
|
|
|
|
|
|
|
|
# Set environment variables for the MPV socket and server host/port
|
2024-09-05 04:34:00 -07:00
|
|
|
ENV LISTEN_ADDRESS="0.0.0.0" \
|
|
|
|
LISTEN_PORT=8080
|
2024-09-04 15:15:40 -07:00
|
|
|
|
|
|
|
# Set the working directory in the container
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
# Copy the current directory contents into the container at /app
|
2024-09-05 04:34:00 -07:00
|
|
|
COPY server.py requirements.txt /app/
|
2024-09-04 15:15:40 -07:00
|
|
|
|
|
|
|
# Install any needed packages specified in requirements.txt
|
|
|
|
# If there are no external dependencies, you can skip this step
|
|
|
|
# RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
|
|
|
|
# Make port 8080 available to the world outside this container
|
|
|
|
EXPOSE "${PORT_NUMBER}"
|
|
|
|
|
2024-09-05 04:34:00 -07:00
|
|
|
RUN pip3 install --no-cache-dir -r requirements.txt
|
2024-09-04 15:15:40 -07:00
|
|
|
|
|
|
|
# Run server.py when the container launches
|
2024-09-05 04:34:00 -07:00
|
|
|
# CMD ["python3", "server.py", "--host", "${LISTEN_ADDRESS}", "--port", "${LISTEN_PORT}", "--input-ipc-server", "${MPV_SOCKET}"]
|
|
|
|
CMD gunicorn --bind "${LISTEN_ADDRESS}":"${LISTEN_PORT}" server:app
|