Skip to content

Commit 66a6cec

Browse files
committed
Configure postgres with pg_profile
1 parent 748458c commit 66a6cec

File tree

5 files changed

+150
-1
lines changed

5 files changed

+150
-1
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@
99
* [Logging](logging/README.md)
1010
* [Tracing](tracing/README.md)
1111
* [Elastic](elastic/README.md)
12+
* [Minio](minio/README.md)
1213
* [Frontend](frontend/README.md)
1314
* [Java](java/README.md)

minio/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Minio
2+
3+
```shell
4+
$ mc alias set local http://localhost:9000 program qwerty123
5+
$ mc mb local/my-bucket
6+
$ mc mv data.txt local/my-bucket/
7+
8+
```

minio/docker-compose.yml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
version: "3.9"
2+
3+
x-minio-common: &minio-common
4+
image:
5+
minio/minio:latest
6+
command: server --console-address ":9001" http://minio-{1...2}/data
7+
expose:
8+
- "9000"
9+
- "9001"
10+
environment:
11+
MINIO_ROOT_USER: program
12+
MINIO_ROOT_PASSWORD: qwerty123
13+
healthcheck:
14+
test: [ "CMD", "curl", "-f", "http://localhost:9000/minio/health/live" ]
15+
interval: 30s
16+
timeout: 20s
17+
retries: 3
18+
19+
services:
20+
minio-1:
21+
<<: *minio-common
22+
hostname: minio-1
23+
volumes:
24+
- data1:/data
25+
26+
minio-2:
27+
<<: *minio-common
28+
hostname: minio-2
29+
volumes:
30+
- data2:/data
31+
32+
nginx:
33+
image: nginx:1.25-alpine
34+
hostname: nginx
35+
volumes:
36+
- ./nginx.conf:/etc/nginx/nginx.conf:ro
37+
ports:
38+
- "9000:9000"
39+
- "9001:9001"
40+
healthcheck:
41+
test: "curl --fail http://localhost:9001 || exit 1"
42+
interval: 10s
43+
timeout: 5s
44+
retries: 5
45+
depends_on:
46+
minio-1:
47+
condition: service_healthy
48+
minio-2:
49+
condition: service_healthy
50+
51+
volumes:
52+
data1:
53+
data2:

minio/nginx.conf

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
user nginx;
2+
worker_processes auto;
3+
4+
error_log /var/log/nginx/error.log warn;
5+
pid /var/run/nginx.pid;
6+
7+
events {
8+
worker_connections 4096;
9+
}
10+
11+
http {
12+
include /etc/nginx/mime.types;
13+
default_type application/octet-stream;
14+
15+
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
16+
'$status $body_bytes_sent "$http_referer" '
17+
'"$http_user_agent" "$http_x_forwarded_for"';
18+
19+
access_log /var/log/nginx/access.log main;
20+
sendfile on;
21+
keepalive_timeout 65;
22+
23+
upstream minio {
24+
server minio-1:9000;
25+
server minio-2:9000;
26+
}
27+
28+
upstream console {
29+
ip_hash;
30+
server minio-1:9001;
31+
server minio-2:9001;
32+
}
33+
34+
server {
35+
listen 9000;
36+
server_name localhost;
37+
38+
ignore_invalid_headers off;
39+
client_max_body_size 0;
40+
proxy_buffering off;
41+
proxy_request_buffering off;
42+
43+
location / {
44+
proxy_set_header Host $http_host;
45+
proxy_set_header X-Real-IP $remote_addr;
46+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
47+
proxy_set_header X-Forwarded-Proto $scheme;
48+
49+
proxy_connect_timeout 300;
50+
proxy_http_version 1.1;
51+
proxy_set_header Connection "";
52+
chunked_transfer_encoding off;
53+
54+
proxy_pass http://minio;
55+
}
56+
}
57+
58+
server {
59+
listen 9001;
60+
server_name localhost;
61+
62+
ignore_invalid_headers off;
63+
client_max_body_size 0;
64+
proxy_buffering off;
65+
proxy_request_buffering off;
66+
67+
location / {
68+
proxy_set_header Host $http_host;
69+
proxy_set_header X-Real-IP $remote_addr;
70+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
71+
proxy_set_header X-Forwarded-Proto $scheme;
72+
proxy_set_header X-NginX-Proxy true;
73+
74+
real_ip_header X-Real-IP;
75+
76+
proxy_connect_timeout 300;
77+
78+
proxy_http_version 1.1;
79+
proxy_set_header Upgrade $http_upgrade;
80+
proxy_set_header Connection "upgrade";
81+
82+
chunked_transfer_encoding off;
83+
84+
proxy_pass http://console;
85+
}
86+
}
87+
}

postgres/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ FROM postgres:15
33
RUN apt-get update && \
44
apt-get install curl -y && \
55
curl -L -o /tmp/pg_profile.tar.gz https://github.com/zubkov-andrei/pg_profile/releases/download/4.7/pg_profile--4.7.tar.gz && \
6-
tar -xf /tmp/pg_profile.tar.gz -C $(pg_config --sharedir)/extension \
6+
tar -xf /tmp/pg_profile.tar.gz -C $(pg_config --sharedir)/extension

0 commit comments

Comments
 (0)