datamk commited on
Commit
36377e9
·
verified ·
1 Parent(s): f47f681

Upload Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +63 -0
Dockerfile ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Project : Screenipy
2
+ # Author : Pranjal Joshi
3
+ # Created : 17/08/2023
4
+ # Description : Dockerfile to build Screeni-py image for GUI release
5
+
6
+ FROM python:3.11.6-slim-bookworm AS base
7
+
8
+ ARG DEBIAN_FRONTEND=noninteractive
9
+
10
+ RUN apt-get update && apt-get install -y --no-install-recommends \
11
+ git vim nano wget curl && \
12
+ apt-get clean && \
13
+ rm -rf /var/lib/apt/lists/*
14
+
15
+ ENV LANG=C.UTF-8 \
16
+ PYTHONUNBUFFERED=TRUE \
17
+ PYTHONDONTWRITEBYTECODE=TRUE \
18
+ SCREENIPY_DOCKER=TRUE \
19
+ SCREENIPY_GUI=TRUE \
20
+ PATH=/opt/program:$PATH
21
+
22
+ ##############
23
+ # Build Phase
24
+ ##############
25
+ FROM base AS build
26
+
27
+ ARG PIP_DISABLE_PIP_VERSION_CHECK=1
28
+ ARG PIP_NO_CACHE_DIR=1
29
+
30
+ WORKDIR /opt/program
31
+
32
+ RUN python3 -m venv /venv
33
+ ENV PATH=/venv/bin:$PATH
34
+
35
+ COPY requirements.txt .
36
+
37
+ RUN --mount=type=cache,target=/root/.cache/pip pip3 install -r requirements.txt
38
+ RUN --mount=type=cache,target=/root/.cache/pip pip3 install --no-deps advanced-ta
39
+
40
+ ##############
41
+ # Package Phase
42
+ ##############
43
+ FROM base AS app
44
+
45
+ COPY --from=build /venv /venv
46
+ ENV PATH=/venv/bin:$PATH
47
+
48
+ WORKDIR /opt/program
49
+
50
+ COPY . .
51
+
52
+ RUN chmod +x ./*
53
+
54
+ EXPOSE 8000
55
+
56
+ EXPOSE 8501
57
+
58
+ HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
59
+
60
+ WORKDIR /opt/program/src
61
+
62
+ ENTRYPOINT ["streamlit", "run", "streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
63
+ # ENTRYPOINT ["tail", "-f", "/dev/null"]