0.0.2 (#1)
All checks were successful
Build Docker Image / build (push) Successful in 23s

Co-authored-by: ksyasuda <ksyasuda@umich.edu>
Reviewed-on: #1
This commit was merged in pull request #1.
This commit is contained in:
2024-09-05 04:37:13 -07:00
parent f0a84c1f41
commit 497320c082
6 changed files with 29 additions and 18 deletions

View File

@@ -2,16 +2,14 @@
FROM python:3.10-slim
# Set environment variables for the MPV socket and server host/port
ENV MPV_SOCKET="/tmp/mpvsocket" \
HOST_NAME="0.0.0.0" \
PORT_NUMBER=8080 \
LOGLEVEL="info"
ENV LISTEN_ADDRESS="0.0.0.0" \
LISTEN_PORT=8080
# Set the working directory in the container
WORKDIR /app
# Copy the current directory contents into the container at /app
COPY server.py /app/server.py
COPY server.py requirements.txt /app/
# Install any needed packages specified in requirements.txt
# If there are no external dependencies, you can skip this step
@@ -20,7 +18,8 @@ COPY server.py /app/server.py
# Make port 8080 available to the world outside this container
EXPOSE "${PORT_NUMBER}"
RUN pip3 install --no-cache-dir Flask mysql-connector-python
RUN pip3 install --no-cache-dir -r requirements.txt
# Run server.py when the container launches
CMD ["python3", "server.py", "--host", "${HOST_NAME}", "--port", "${PORT_NUMBER}", "--input-ipc-server", "${MPV_SOCKET}"]
# CMD ["python3", "server.py", "--host", "${LISTEN_ADDRESS}", "--port", "${LISTEN_PORT}", "--input-ipc-server", "${MPV_SOCKET}"]
CMD gunicorn --bind "${LISTEN_ADDRESS}":"${LISTEN_PORT}" server:app