-
Notifications
You must be signed in to change notification settings - Fork 98
/
Copy pathdockerfile
43 lines (29 loc) · 1.13 KB
/
dockerfile
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
37
38
39
40
41
42
43
# Use an official Python runtime as a parent image
FROM python:3.10-slim
# Install system dependencies
RUN apt-get update && apt-get install -y git procps
# Set the working directory in the container
WORKDIR /app
# Copy the requirements file into the container
COPY requirements.txt .
# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# Install supervisor
RUN apt-get update && apt-get install -y supervisor
# Install Celery
RUN pip install --no-cache-dir celery
# Install NLTK and download required data
RUN pip install --no-cache-dir nltk
RUN python -c "import nltk; nltk.download('punkt');"
# Copy the rest of the application code into the container
COPY . .
# env path for newrelic.ini
ENV NEW_RELIC_CONFIG_FILE=/app/newrelic.ini
# Copy the Supervisor configuration file into the container
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# Expose the port that the app runs on
EXPOSE 8001
# Define environment variable
ENV PYTHONUNBUFFERED=1
# Run Supervisor when the container launches
CMD ["supervisord", "-n", "-c", "/etc/supervisor/conf.d/supervisord.conf"]