-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDockerfile
executable file
·37 lines (33 loc) · 945 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
32
33
34
35
36
37
#!/usr/bin/env -S docker image build -t colsearch . -f
# Base image
FROM python:3.10 AS base
ENV STREAMLIT_BROWSER_GATHER_USAGE_STATS=false
WORKDIR /app
RUN pip install --no-cache-dir \
altair \
"elasticsearch>=7.0.0,<8.0.0" \
fastapi \
matplotlib \
pandas \
pydantic \
requests \
streamlit \
"uvicorn[standard]" \
wordcloud \
pyyaml
# Lint code
FROM base
RUN pip install --no-cache-dir pylint
COPY . ./
RUN pylint *.py \
--max-line-length=120 \
--good-names="c,ct,e,ep,id,q,r" \
--disable="C0103,C0114,C0115,C0116" \
--extension-pkg-whitelist="pydantic"
# Build image
FROM base
# Create a non-root user
RUN adduser --disabled-password --gecos "" appuser
COPY --chown=appuser:appuser . ./
USER appuser
CMD ["./api.py"]