-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
99 lines (68 loc) · 2.57 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# FROM python:3.9
# WORKDIR /usr/src/app
# RUN apt-get update && apt-get install -y \
# tesseract-ocr \
# libtesseract-dev \
# && apt-get clean \
# && rm -rf /var/lib/apt/lists/*
# COPY requirements.txt /usr/src/app/
# #COPY celery_worker/requirements_new.txt /celery_worker/
# RUN pip install --no-cache-dir -r requirements.txt
# #RUN pip install --no-cache-dir -r /celery_worker/requirements_new.txt
# COPY src/ /usr/src/app/src/
# COPY ./config.yml /usr/src/app/config/
# COPY schema/ /usr/src/app/schema/
# WORKDIR /celery_worker
# COPY celery_worker/ .
# COPY ./config.yml ./config/
# WORKDIR /usr/src/app
# ENV OPENAI_API_KEY=${OPENAI_API_KEY}
# ENV CONFIG_FILE=${CONFIG_FILE}
# ENV CELERY_BROKER_URL=${CELERY_BROKER_URL}
# ENV CELERY_RESULT_BACKEND=${CELERY_RESULT_BACKEND}
# CMD ["python", "./src/main.py"]
# # for running the Celery worker, comment out the above CMD line
# #and uncomment the following ENTRYPOINT line when building the image for a worker
# # ENTRYPOINT ["celery", "-A", "chatGPTAsk", "worker", "-l", "info", "-E"]
# FROM python:3.9
# WORKDIR /usr/src/app
# RUN apt-get update && apt-get install -y \
# tesseract-ocr \
# libtesseract-dev \
# && apt-get clean \
# && rm -rf /var/lib/apt/lists/*
# COPY requirements.txt /usr/src/app/
# RUN pip install --no-cache-dir -r requirements.txt
# COPY src/ /usr/src/app/src/
# COPY config/config.yml /usr/src/app/config/
# COPY schema/ /usr/src/app/schema/
# WORKDIR /celery_worker
# COPY celery_worker/ .
# COPY config/config.yml ./config/
# WORKDIR /usr/src/app
# ENV OPENAI_API_KEY=${OPENAI_API_KEY}
# ENV CONFIG_FILE=/usr/src/app/config/config.yml
# ENV CELERY_BROKER_URL=${CELERY_BROKER_URL}
# ENV CELERY_RESULT_BACKEND=${CELERY_RESULT_BACKEND}
# ENV PYTHONPATH "${PYTHONPATH}:/usr/src/app"
# CMD ["python", "./src/main.py"]
# # ENTRYPOINT ["celery", "-A", "chatGPTAsk", "worker", "-l", "info", "-E"]
FROM python:3.9
WORKDIR /usr/src/app
RUN apt-get update && apt-get install -y \
tesseract-ocr \
libtesseract-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY src/ ./src/
COPY celery_worker/ ./celery_worker/
COPY config/ ./config/
COPY schema/ ./schema/
ENV OPENAI_API_KEY=${OPENAI_API_KEY}
ENV CONFIG_FILE=/usr/src/app/config/config.yml
ENV CELERY_BROKER_URL=${CELERY_BROKER_URL}
ENV CELERY_RESULT_BACKEND=${CELERY_RESULT_BACKEND}
ENV PYTHONPATH /usr/src/app
CMD ["python", "./src/main.py"]