Update Dockerfile
Browse files- Dockerfile +5 -6
Dockerfile
CHANGED
@@ -29,16 +29,15 @@ RUN apt-get update && apt-get install -y \
|
|
29 |
&& usermod -aG sudo user \
|
30 |
&& echo "user ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
|
31 |
|
32 |
-
# Create directories
|
33 |
-
RUN mkdir -p /app/api /app/web /data/storage && \
|
|
|
34 |
chown -R postgres:postgres /var/lib/postgresql && \
|
35 |
-
chmod
|
36 |
|
37 |
# Initialize PostgreSQL database as postgres user
|
38 |
USER postgres
|
39 |
-
RUN
|
40 |
-
chmod 700 /var/lib/postgresql/data && \
|
41 |
-
/usr/lib/postgresql/15/bin/initdb -D /var/lib/postgresql/data && \
|
42 |
echo "host all all 0.0.0.0/0 md5" >> /var/lib/postgresql/data/pg_hba.conf && \
|
43 |
echo "listen_addresses='*'" >> /var/lib/postgresql/data/postgresql.conf
|
44 |
|
|
|
29 |
&& usermod -aG sudo user \
|
30 |
&& echo "user ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
|
31 |
|
32 |
+
# Create directories with correct permissions
|
33 |
+
RUN mkdir -p /app/api /app/web /data/storage /var/lib/postgresql/data && \
|
34 |
+
chmod 777 /data /app && \
|
35 |
chown -R postgres:postgres /var/lib/postgresql && \
|
36 |
+
chmod 700 /var/lib/postgresql/data
|
37 |
|
38 |
# Initialize PostgreSQL database as postgres user
|
39 |
USER postgres
|
40 |
+
RUN /usr/lib/postgresql/15/bin/initdb -D /var/lib/postgresql/data && \
|
|
|
|
|
41 |
echo "host all all 0.0.0.0/0 md5" >> /var/lib/postgresql/data/pg_hba.conf && \
|
42 |
echo "listen_addresses='*'" >> /var/lib/postgresql/data/postgresql.conf
|
43 |
|