-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
34 lines (23 loc) · 907 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
ARG VERSION=14
FROM postgres:${VERSION}
ARG VERSION
ENV POSTGRESQL_USER postgres
ENV POSTGRES_PASSWORD password
# to run with non-root PID
ENV PGDATA /temp/data
RUN apt-get update \
&& apt-get install -y postgresql-${VERSION}-cron \
postgresql-${VERSION}-partman procps \
&& rm -rf /var/lib/apt/lists/*
COPY ./etc/*.conf /etc/postgresql/
RUN mkdir -p /docker-entrypoint-initdb.d/sqls
COPY ./schema/postgres/*.sh /docker-entrypoint-initdb.d/
COPY ./schema/postgres/sqls/* /docker-entrypoint-initdb.d/sqls/
COPY ./schema/postgres/version /docker-entrypoint-initdb.d/sqls/
# to run with non-root PID
RUN mkdir /temp
RUN chmod 777 /temp
RUN chmod -R 777 /var/log
RUN mkdir -p /var/run/postgresql && chmod -R 777 /var/run
RUN chmod -R 777 /docker-entrypoint-initdb.d
CMD ["postgres", "-c", "config_file=/etc/postgresql/postgresql.conf", "-c", "hba_file=/etc/postgresql/pg_hba.conf"]