bpandey23 commited on
Commit
dd1c000
1 Parent(s): 6b37c94

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +25 -20
Dockerfile CHANGED
@@ -1,26 +1,31 @@
1
- # Use the official PostgreSQL image as the base image
2
- FROM postgres:13
3
 
4
- # Set the environment variables for the PostgreSQL database
5
- ENV POSTGRES_DB=mydb
6
- ENV POSTGRES_USER=myuser
7
- ENV POSTGRES_PASSWORD=mypassword
 
 
 
 
 
 
 
8
 
9
- # Check if the postgres user and group exist, and create them if not
10
- RUN if ! id -g postgres > /dev/null 2>&1; then groupadd -r postgres; fi
11
- RUN if ! id -u postgres > /dev/null 2>&1; then useradd -r -g postgres postgres; fi
 
 
 
 
 
12
 
13
- # Set the ownership of the data directory
14
- RUN mkdir -p /var/lib/postgresql/data && chown -R postgres:postgres /var/lib/postgresql/data
15
 
16
- # Copy the init.sql file to the container
17
- COPY init.sql /docker-entrypoint-initdb.d/
18
 
19
- # Expose the default PostgreSQL port
20
- EXPOSE 5432
21
 
22
- # Run the PostgreSQL process as the custom user
23
- USER postgres
24
-
25
- # Start the PostgreSQL server when the container is launched
26
- CMD ["postgres"]
 
1
+ #FROM ubuntu:22.04
2
+ FROM ubuntu:22.04
3
 
4
+ # Install necessary packages
5
+ RUN apt-get update && apt-get install -y \
6
+ curl \
7
+ wget \
8
+ unzip \
9
+ git \
10
+ python3-pip \
11
+ libmagic-dev \
12
+ lsb-release \
13
+ lsof \
14
+ postgresql \
15
 
16
+ #NEEDED FOR POSTGRES16
17
+ RUN curl -fsSL --insecure https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor -o /etc/apt/trusted.gpg.d/postgresql.gpg
18
+
19
+ RUN apt-get update && apt-get install -y postgresql-client-16
20
+
21
+
22
+ # Install Python dependencies - FOR
23
+ RUN pip3 install -r requirements.txt
24
 
25
+ # Expose ports
26
+ EXPOSE 8501
27
 
 
 
28
 
29
+ WORKDIR postgres
 
30
 
31
+ RUN python3 -m streamlit run app.py