# Use an official Python runtime as a parent image
FROM python:3.8-alpine

# Copy pip configs for private repo
RUN mkdir -p /root/.config/pip/
COPY pip.conf /root/.config/pip/
COPY .pypirc /root/

# Set the working directory to /app
WORKDIR /app

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

# Install Python dependencies
RUN apk update
RUN apk add musl-dev linux-headers gcc libc-dev python3-dev libffi-dev openssl-dev

# Install any needed packages specified in requirements.txt
RUN pip install --upgrade pip setuptools
RUN pip install --trusted-host pypi.python.org -r requirements.txt

# Run application with uWSGI when the container launches
CMD ["python", "main.py"]
