-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
44 lines (33 loc) · 1.06 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
FROM python:3.10-slim
# arguments
ARG DEV_MODE
# environment
ENV PYTHONFAULTHANDLER=1 \
PYTHONUNBUFFERED=1 \
PYTHONHASHSEED=random \
PIP_NO_CACHE_DIR=off \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100 \
POETRY_VERSION=1.1.13 \
POETRY_VERSION=1.3.1 \
URLLIB_VERSION=1.26.15 \
DAGSTER_HOME=/opt/dagster/dagster_home
# create a directory and make it accessible to the user
RUN mkdir /app
# poetry
RUN pip install "poetry==$POETRY_VERSION" "urllib3==$URLLIB_VERSION"
# copy only requirements to cache them in docker layer
WORKDIR /app
COPY src/pyproject.toml /app/
# project initialization
RUN poetry config virtualenvs.create false \
&& poetry install $(test "${DEV_MODE}" != prototype && echo "--no-dev") --no-interaction --no-ansi
# USER $USERNAME
COPY src/ /app/src/
COPY data/ /app/data/
COPY creds/creds.sample.json /app/creds/creds.json
ENV PYTHONPATH "${PYTHONPATH}:/app/src"
EXPOSE 8181
# run
WORKDIR /app/src/
CMD ["streamlit", "run", "Homepage.py", "--server.port", "8181", "--server.address", "0.0.0.0" , "--browser.gatherUsageStats", "False"]