1c0eb91333
- change from mysql-connector-python to sqlalchemy - allow for connection to sqlite3, mysql, mariadb, postgres, and oracle databases - change `DATE` columns to `DATETIME` type - add WHO columns - install database connectors and required packages
32 lines
1.0 KiB
Docker
32 lines
1.0 KiB
Docker
# 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
|
|
ENV LISTEN_ADDRESS="0.0.0.0" \
|
|
LISTEN_PORT=8080
|
|
|
|
RUN apt-get update && apt-get install -y \
|
|
build-essential \
|
|
libpq-dev \
|
|
gcc \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Set the working directory in the container
|
|
WORKDIR /app
|
|
|
|
# Copy the current directory contents into the container at /app
|
|
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
|
|
# RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Make port 8080 available to the world outside this container
|
|
EXPOSE "${PORT_NUMBER}"
|
|
|
|
RUN pip3 install --no-cache-dir -r requirements.txt
|
|
|
|
# Run server.py when the container launches
|
|
# CMD ["python3", "server.py", "--host", "${LISTEN_ADDRESS}", "--port", "${LISTEN_PORT}", "--input-ipc-server", "${MPV_SOCKET}"]
|
|
CMD gunicorn --bind "${LISTEN_ADDRESS}":"${LISTEN_PORT}" server:app
|