# Use an official Python runtime as a parent image
FROM python:3.11-slim

# Set the working directory in the container
WORKDIR /app

# Copy the current directory contents into the container at /app
COPY ./src /app/src

# Copy poetry files
COPY pyproject.toml /app/
# If there's a poetry lock file, include the following line
COPY poetry.lock /app/

# Install poetry
RUN pip install poetry

# Install dependencies
RUN poetry install --no-dev

# Make port 5050 available to the world outside this container
EXPOSE 5050

# Run backend server
CMD ["poetry", "run", "python", "src/talemate/server/run.py", "runserver", "--host", "0.0.0.0", "--port", "5050"]