-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
31 lines (21 loc) · 858 Bytes
/
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
FROM node:14-alpine as builder
WORKDIR /
COPY ./sentiment-frontend/ .
RUN npm install && npm run build
FROM python:3.8-slim
WORKDIR /
RUN apt-get update \
&& apt-get install -y --no-install-recommends git \
&& apt-get purge -y --auto-remove \
&& rm -rf /var/lib/apt/lists/*
COPY sentiment-backend/requirements.txt /requirements.txt
COPY sentiment-backend/requirements-base.txt /requirements-base.txt
RUN pip install --no-cache-dir --upgrade pip \
&& pip install --compile --no-cache-dir -r /requirements.txt \
&& rm -rf /root/.cache/pip
COPY sentiment-backend/sentiment /sentiment
COPY sentiment-backend/trigger_download.py /trigger_download.py
RUN python /trigger_download.py
RUN mkdir /sentiment/static
COPY --from=builder /dist/ /sentiment/static/
CMD ["uvicorn", "sentiment.main:app", "--host", "0.0.0.0", "--port", "8000"]