Create Dockerfile
Browse files- Dockerfile +19 -0
Dockerfile
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use the official PostgreSQL image from the Docker Hub
|
2 |
+
FROM postgres:latest
|
3 |
+
|
4 |
+
# Environment variables for PostgreSQL setup
|
5 |
+
ENV POSTGRES_DB=mydatabase
|
6 |
+
ENV POSTGRES_USER=myuser
|
7 |
+
ENV POSTGRES_PASSWORD=mypassword
|
8 |
+
|
9 |
+
# Copy the custom PostgreSQL configuration file
|
10 |
+
COPY postgresql.conf /etc/postgresql/postgresql.conf
|
11 |
+
|
12 |
+
# Copy initialization scripts to the Docker container
|
13 |
+
COPY init.sql /docker-entrypoint-initdb.d/
|
14 |
+
|
15 |
+
# Expose the custom port
|
16 |
+
EXPOSE 7860
|
17 |
+
|
18 |
+
# Run PostgreSQL with the custom configuration file
|
19 |
+
CMD ["postgres", "-c", "config_file=/etc/postgresql/postgresql.conf"]
|