leo-bourrel commited on
Commit
26b6fc7
·
1 Parent(s): 21b5e48

feat: postgreSQL docker image

Browse files
Files changed (2) hide show
  1. Dockerfile +14 -27
  2. execution.sh +7 -0
Dockerfile CHANGED
@@ -1,39 +1,26 @@
1
- # app/Dockerfile
2
-
3
- FROM python:3.10-slim
4
 
5
  WORKDIR /app
6
 
7
- RUN apt-get update && apt-get install -y \
8
- build-essential \
9
- curl \
10
- software-properties-common \
11
- git \
12
  libpq-dev \
13
- gcc \
14
- libgomp1 \
15
- libatlas-base-dev \
16
- liblapack-dev \
17
- wget \
18
- && rm -rf /var/lib/apt/lists/*
19
 
20
  COPY ./ /app/
21
 
22
- # INSTALL LATEST SQLITE3 FROM SOURCE
23
- RUN wget https://www.sqlite.org/2023/sqlite-autoconf-3430200.tar.gz
24
- RUN tar xvfz sqlite-autoconf-3430200.tar.gz
25
- RUN mv sqlite-autoconf-3430200 /usr/local/share/sqlite3
26
- WORKDIR /usr/local/share/sqlite3/
27
- RUN ./configure
28
- RUN make -j
29
- RUN make install
30
- RUN cp sqlite3 /usr/bin/
31
- WORKDIR /app
32
-
33
- RUN pip3 install -r /app/requirements.txt
34
 
35
  EXPOSE 7860
36
 
 
 
 
 
37
  HEALTHCHECK CMD curl --fail http://localhost:7860/_stcore/health
38
 
39
- ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]
 
 
 
1
+ FROM postgres:14.3
 
 
2
 
3
  WORKDIR /app
4
 
5
+ RUN apt update && \
6
+ apt install -y \
7
+ python3 \
8
+ python3-pip \
 
9
  libpq-dev \
10
+ htop
 
 
 
 
 
11
 
12
  COPY ./ /app/
13
 
14
+ RUN pip3 install -r ./requirements.txt
 
 
 
 
 
 
 
 
 
 
 
15
 
16
  EXPOSE 7860
17
 
18
+ COPY "execution.sh" "/usr/local/bin/"
19
+
20
+ ENTRYPOINT ["execution.sh"]
21
+
22
  HEALTHCHECK CMD curl --fail http://localhost:7860/_stcore/health
23
 
24
+ STOPSIGNAL SIGINT
25
+
26
+ CMD ["postgres"]
execution.sh ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+
3
+ bash /usr/local/bin/docker-entrypoint.sh "$@" &
4
+
5
+ sleep 2
6
+
7
+ streamlit run app.py --server.port=7860 --server.address=0.0.0.0