Spaces:
Runtime error
Runtime error
# Use an official Python runtime as a parent image | |
FROM python:3.8-slim-buster | |
# Set environment variables | |
ENV PYTHONUNBUFFERED 1 | |
# Set work directory in the container | |
WORKDIR /app | |
# Install necessary packages | |
RUN apt-get update \ | |
&& apt-get install -y nginx \ | |
&& apt-get clean | |
# Copy the current directory contents into the container at /app | |
COPY . /app | |
# Install any needed packages specified in requirements.txt | |
RUN pip install --no-cache-dir -r requirements.txt | |
# Setup NGINX | |
RUN rm /etc/nginx/sites-enabled/default | |
COPY nginx.conf /etc/nginx/sites-available/ | |
RUN ln -s /etc/nginx/sites-available/nginx.conf /etc/nginx/sites-enabled/ | |
# Expose port for the app | |
EXPOSE 7680 | |
# Start the application | |
CMD service nginx start && python app.py | |