diff --git a/Dockerfile b/Dockerfile index 4578ab3..3e95404 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,11 @@ WORKDIR /tools # 安装依赖 RUN yum -y install util-linux dos2unix +RUN yum -y install postgresql postgresql-server \ + &&mkdir /data\ + &&chown -R postgres /data\ + &&chown -R postgres /tools + ENV TZ=Asia/Shanghai COPY ./update-pg-password.sh /usr/local/bin @@ -17,12 +22,9 @@ RUN chmod +x /usr/local/bin/docker-entrypoint.sh RUN chmod +x /usr/local/bin/update-pg-password.sh RUN chmod +x /docker-entrypoint-initdb.d/10_eulixspace.sh +ENTRYPOINT ["docker-entrypoint.sh"] -RUN yum -y install postgresql postgresql-server \ - &&mkdir /data\ - &&chown -R postgres /data\ - &&chown -R postgres /tools +STOPSIGNAL SIGINT -USER postgres -RUN initdb -D /data \ - &&pg_ctl -D /data/ -l /data/logfile start \ No newline at end of file +EXPOSE 5432 +CMD ["postgres"] \ No newline at end of file