volumes:
- type: volume
source: site-db-vol
target: /var/lib/postgresql/data
- type: bind
// Просто подменяю файл в контейнере файлом с локалки
source: ${POSTGRES_CONFIG_FILE_SRC}
target: /var/lib/postgresql/data/postgresql.conf
# CONNECTIONS AND AUTHENTICATION
listen_addresses = '*'
#port = 5432 # (change requires restart)
# REPORTING AND LOGGING
log_destination = 'stderr'
logging_collector = on
log_directory = '/var/lib/postgresql/'
log_min_messages = debug1
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
local replication all trust
host replication all 127.0.0.1/32 trust
host replication all ::1/128 trust
host all all all scram-sha-256
2022-08-10 10:29:11.160 GMT [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
2022-08-10 10:29:11.160 GMT [1] LOG: listening on IPv6 address "::", port 5432
2022-08-10 10:29:11.244 GMT [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2022-08-10 10:29:11.350 GMT [22] LOG: database system was shut down at 2022-08-10 07:58:37 GMT
2022-08-10 10:29:11.390 GMT [22] DEBUG: checkpoint record is at 0/16FDBA0
2022-08-10 10:29:11.391 GMT [22] DEBUG: redo record is at 0/16FDBA0; shutdown true
2022-08-10 10:29:11.391 GMT [22] DEBUG: next transaction ID: 734; next OID: 13770
2022-08-10 10:29:11.391 GMT [22] DEBUG: next MultiXactId: 1; next MultiXactOffset: 0
2022-08-10 10:29:11.391 GMT [22] DEBUG: oldest unfrozen transaction ID: 727, in database 1
2022-08-10 10:29:11.391 GMT [22] DEBUG: oldest MultiXactId: 1, in database 1
2022-08-10 10:29:11.391 GMT [22] DEBUG: commit timestamp Xid oldest/newest: 0/0
2022-08-10 10:29:11.391 GMT [22] DEBUG: transaction ID wrap limit is 2147484374, limited by database with OID 1
2022-08-10 10:29:11.391 GMT [22] DEBUG: MultiXactId wrap limit is 2147483648, limited by database with OID 1
2022-08-10 10:29:11.391 GMT [22] DEBUG: starting up replication slots
2022-08-10 10:29:11.488 GMT [22] DEBUG: MultiXactId wrap limit is 2147483648, limited by database with OID 1
2022-08-10 10:29:11.488 GMT [22] DEBUG: MultiXact member stop limit is now 4294914944 based on MultiXact 1
2022-08-10 10:29:11.496 GMT [1] DEBUG: starting background worker process "logical replication launcher"
2022-08-10 10:29:11.496 GMT [1] LOG: database system is ready to accept connections
2022-08-10 10:29:11.507 GMT [26] DEBUG: autovacuum launcher started
2022-08-10 10:29:11.511 GMT [28] DEBUG: logical replication launcher started
2022-08-10 10:30:11.743 GMT [29] DEBUG: autovacuum: processing database "postgres"
2022-08-10 10:31:11.676 GMT [30] DEBUG: autovacuum: processing database "postgres"
2022-08-10 10:32:11.666 GMT [31] DEBUG: autovacuum: processing database "postgres"
2022-08-10 10:33:11.704 GMT [32] DEBUG: autovacuum: processing database "postgres"
2022-08-10 10:34:11.604 GMT [23] DEBUG: performing replication slot checkpoint
2022-08-10 10:34:11.738 GMT [33] DEBUG: autovacuum: processing database "postgres"
2022-08-10 10:35:11.773 GMT [52] DEBUG: autovacuum: processing database "postgres"
2022-08-10 10:36:11.847 GMT [53] DEBUG: autovacuum: processing database "postgres"
2022-08-10 10:37:11.867 GMT [60] DEBUG: autovacuum: processing database "postgres"
2022-08-10 10:38:11.928 GMT [68] DEBUG: autovacuum: processing database "postgres"
2022-08-10 10:39:11.676 GMT [23] DEBUG: checkpoint skipped because system is idle
2022-08-10 10:39:11.936 GMT [73] DEBUG: autovacuum: processing database "postgres"
[romaro@ora19c gp]$ sudo ss -tulpn
Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
udp UNCONN 0 0 0.0.0.0:111 0.0.0.0:* users:(("rpcbind",pid=778,fd=5),("systemd",pid=1,fd=39))
udp UNCONN 0 0 127.0.0.1:323 0.0.0.0:* users:(("chronyd",pid=827,fd=6))
udp UNCONN 0 0 [::]:111 [::]:* users:(("rpcbind",pid=778,fd=7),("systemd",pid=1,fd=41))
udp UNCONN 0 0 [::1]:323 [::]:* users:(("chronyd",pid=827,fd=7))
tcp LISTEN 0 128 0.0.0.0:22 0.0.0.0:* users:(("sshd",pid=838,fd=4))
tcp LISTEN 0 511 127.0.0.1:19383 0.0.0.0:* users:(("node",pid=1776,fd=18))
tcp LISTEN 0 1024 0.0.0.0:3000 0.0.0.0:* users:(("docker-proxy",pid=2155,fd=4))
tcp LISTEN 0 1024 0.0.0.0:5433 0.0.0.0:* users:(("docker-proxy",pid=2139,fd=4))
tcp LISTEN 0 1024 0.0.0.0:443 0.0.0.0:* users:(("docker-proxy",pid=2345,fd=4))
tcp LISTEN 0 128 0.0.0.0:111 0.0.0.0:* users:(("rpcbind",pid=778,fd=4),("systemd",pid=1,fd=38))
tcp LISTEN 0 1024 0.0.0.0:80 0.0.0.0:* users:(("docker-proxy",pid=2362,fd=4))
tcp LISTEN 0 128 [::]:22 [::]:* users:(("sshd",pid=838,fd=6))
tcp LISTEN 0 1024 [::]:3000 [::]:* users:(("docker-proxy",pid=2159,fd=4))
tcp LISTEN 0 1024 [::]:5433 [::]:* users:(("docker-proxy",pid=2143,fd=4))
tcp LISTEN 0 1024 [::]:443 [::]:* users:(("docker-proxy",pid=2350,fd=4))
tcp LISTEN 0 128 [::]:111 [::]:* users:(("rpcbind",pid=778,fd=6),("systemd",pid=1,fd=40))
tcp LISTEN 0 1024 [::]:80 [::]:* users:(("docker-proxy",pid=2366,fd=4))
PID USER TIME COMMAND
1 postgres 0:00 postgres
22 postgres 0:00 postgres: checkpointer
23 postgres 0:00 postgres: background writer
24 postgres 0:00 postgres: walwriter
25 postgres 0:00 postgres: autovacuum launcher
26 postgres 0:00 postgres: stats collector
27 postgres 0:00 postgres: logical replication launcher
28 root 0:00 /bin/ash
56 root 0:00 ps
[romaro@ora19c gp]$ netstat -ltpn
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:24501 0.0.0.0:* LISTEN 1775/node
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:3000 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:5433 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN -
tcp6 0 0 :::111 :::* LISTEN -
tcp6 0 0 :::80 :::* LISTEN -
tcp6 0 0 :::22 :::* LISTEN -
tcp6 0 0 :::3000 :::* LISTEN -
tcp6 0 0 :::5433 :::* LISTEN -
tcp6 0 0 :::443 :::* LISTEN -
postgres:
image: postgres:14.4-alpine3.16
container_name: gp_site_db
env_file:
- ./secrets/postgres.env
expose: [5433]
ports:
- 5433:5433 #host_port:container_port
volumes:
- type: volume
source: site-db-vol
target: /var/lib/postgresql/data
/ # netstat -ltpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.11:41079 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:5433 0.0.0.0:* LISTEN -
tcp 0 0 :::5433 :::* LISTEN -
location /static/ {
root /etc;
autoindex off;
}
# IMGProxy
# location /teaser {
# proxy_pass http://imgproxy:8080;
# }
/home/romaro/gp/files/test.txt
- type: bind
source: /home/romaro/gp/files
target: /etc/static
location /static {
root /etc;
}
gp-nginx | 10.0.2.2 - - [08/Jul/2022:07:50:34 +0000] "GET / HTTP/1.1" 404 146 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0"
gp-nginx | 10.0.2.2 - - [08/Jul/2022:07:50:41 +0000] "GET /static HTTP/1.1" 404 146 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0"
gp-nginx | 10.0.2.2 - - [08/Jul/2022:07:50:52 +0000] "GET /static/test.txt HTTP/1.1" 404 146 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0"
This might feel a bit cumbersome at first, but TypeScript tooling like auto-imports and path completion will typically just do this for you.
Просто хочу понять, как принято в сообществе.