1+ FROM  quay.io/enterprisedb/edb-postgres-advanced:17.4-3.5-postgis
2+ USER  root
3+ #  this 777 will be replaced by 700 at runtime (allows semi-arbitrary "--user" values)
4+ RUN  chown -R postgres:postgres /var/lib/edb && chmod 777 /var/lib/edb && rm /docker-entrypoint-initdb.d/10_postgis.sh
5+ 
6+ USER  postgres
7+ ENV  LANG en_US.utf8
8+ ENV  PG_MAJOR 17
9+ ENV  PG_VERSION 17
10+ ENV  PGPORT 5444
11+ ENV  PGDATA /var/lib/edb/as$PG_MAJOR/data/
12+ VOLUME  /var/lib/edb/as$PG_MAJOR/data/
13+ 
14+ COPY  docker-entrypoint.sh /usr/local/bin/
15+ ENTRYPOINT  ["docker-entrypoint.sh" ]
16+ 
17+ #  We set the default STOPSIGNAL to SIGINT, which corresponds to what PostgreSQL
18+ #  calls "Fast Shutdown mode" wherein new connections are disallowed and any
19+ #  in-progress transactions are aborted, allowing PostgreSQL to stop cleanly and
20+ #  flush tables to disk, which is the best compromise available to avoid data
21+ #  corruption.
22+ # 
23+ #  Users who know their applications do not keep open long-lived idle connections
24+ #  may way to use a value of SIGTERM instead, which corresponds to "Smart
25+ #  Shutdown mode" in which any existing sessions are allowed to finish and the
26+ #  server stops when all sessions are terminated.
27+ # 
28+ #  See https://www.postgresql.org/docs/12/server-shutdown.html for more details
29+ #  about available PostgreSQL server shutdown signals.
30+ # 
31+ #  See also https://www.postgresql.org/docs/12/server-start.html for further
32+ #  justification of this as the default value, namely that the example (and
33+ #  shipped) systemd service files use the "Fast Shutdown mode" for service
34+ #  termination.
35+ # 
36+ STOPSIGNAL  SIGINT
37+ # 
38+ #  An additional setting that is recommended for all users regardless of this
39+ #  value is the runtime "--stop-timeout" (or your orchestrator/runtime's
40+ #  equivalent) for controlling how long to wait between sending the defined
41+ #  STOPSIGNAL and sending SIGKILL (which is likely to cause data corruption).
42+ # 
43+ #  The default in most runtimes (such as Docker) is 10 seconds, and the
44+ #  documentation at https://www.postgresql.org/docs/12/server-start.html notes
45+ #  that even 90 seconds may not be long enough in many instances.
46+ 
47+ EXPOSE  5444
48+ CMD  ["postgres" ]
0 commit comments