-
Notifications
You must be signed in to change notification settings - Fork 215
/
Copy pathDockerfile
63 lines (43 loc) · 1.38 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
# Project : Screenipy
# Author : Pranjal Joshi
# Created : 17/08/2023
# Description : Dockerfile to build Screeni-py image for GUI release
FROM python:3.11.6-slim-bookworm AS base
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
git vim nano wget curl && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
ENV LANG=C.UTF-8 \
PYTHONUNBUFFERED=TRUE \
PYTHONDONTWRITEBYTECODE=TRUE \
SCREENIPY_DOCKER=TRUE \
SCREENIPY_GUI=TRUE \
PATH=/opt/program:$PATH
##############
# Build Phase
##############
FROM base AS build
ARG PIP_DISABLE_PIP_VERSION_CHECK=1
ARG PIP_NO_CACHE_DIR=1
WORKDIR /opt/program
RUN python3 -m venv /venv
ENV PATH=/venv/bin:$PATH
COPY requirements.txt .
RUN --mount=type=cache,target=/root/.cache/pip pip3 install -r requirements.txt
RUN --mount=type=cache,target=/root/.cache/pip pip3 install --no-deps advanced-ta
##############
# Package Phase
##############
FROM base AS app
COPY --from=build /venv /venv
ENV PATH=/venv/bin:$PATH
WORKDIR /opt/program
COPY . .
RUN chmod +x ./*
EXPOSE 8000
EXPOSE 8501
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
WORKDIR /opt/program/src
ENTRYPOINT ["streamlit", "run", "streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
# ENTRYPOINT ["tail", "-f", "/dev/null"]