File size: 825 Bytes
6f699a8
 
e2cf778
6f699a8
 
 
 
e2cf778
6f699a8
 
e2cf778
6f699a8
 
 
 
e2cf778
6f699a8
 
e2cf778
6f699a8
 
e2cf778
6f699a8
 
 
 
e2cf778
6f699a8
 
e2cf778
6f699a8
 
e2cf778
6f699a8
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Use an official Python runtime as a parent image
FROM python:3.8-slim-buster

# Set environment variables
ENV PYTHONUNBUFFERED 1
ENV API_ENDPOINT=""
ENV WORKERS=2

# 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/

# Test Nginx config
RUN nginx -t

# Expose port for the app
EXPOSE 7680

# Start the application
CMD service nginx start && python app.py