-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
43 lines (31 loc) · 1021 Bytes
/
Dockerfile
File metadata and controls
43 lines (31 loc) · 1021 Bytes
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
FROM python AS dev
RUN mkdir app
COPY ./requirements.txt /app
WORKDIR /app
RUN pip install -r requirements.txt
ARG DATABASE__CREATE=False
ARG SENDGRID_API_KEY
ENV FLASK_ENV=development \
REDIS_URL=redis \
DATABASE__USER=postgres_development \
DATABASE__PWD=dbs_development \
DATABASE__HOST=postgres_development:5432 \
DATABASE__DBS=text_classification_development \
DATABASE__CREATE=$DATABASE__CREATE \
SENDGRID_API_KEY=$SENDGRID_API_KEY
EXPOSE 5000
CMD ["python", "-m", "run"]
# Production image with different env values
FROM dev AS prod
ARG DATABASE__CREATE=False
ARG SENDGRID_API_KEY
ENV FLASK_ENV=production \
REDIS_URL=redis \
FLASK_PORT=8000 \
DATABASE__USER=postgres_production \
DATABASE__PWD=dbs_production \
DATABASE__HOST=postgres_production:5432 \
DATABASE__DBS=text_classification_production \
DATABASE__CREATE=$DATABASE__CREATE \
SENDGRID_API_KEY=$SENDGRID_API_KEY
CMD ["celery", "-A", "celery_worker.celery worker", "-l", "INFO"]