Skip to content

Commit 62ae6bd

Browse files
committed
first commit
0 parents  commit 62ae6bd

File tree

7 files changed

+964
-0
lines changed

7 files changed

+964
-0
lines changed

.github/workflows/build-and-push.yaml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Build and push
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
jobs:
10+
build-and-push:
11+
name: Build and push
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Login to Twir registry
15+
uses: docker/login-action@v3
16+
with:
17+
registry: registry.twir.app
18+
username: ${{ secrets.DOCKER_TWIR_LOGIN }}
19+
password: ${{ secrets.DOCKER_TWIR_PASSWORD }}
20+
- name: Login to Docker Hub
21+
uses: docker/login-action@v3
22+
with:
23+
username: ${{ secrets.DOCKER_REGISTRY_LOGIN }}
24+
password: ${{ secrets.DOCKER_REGISTRY_TOKEN }}
25+
26+
- name: Set up Docker Buildx
27+
uses: docker/setup-buildx-action@v3
28+
29+
- name: Build docker image
30+
uses: docker/build-push-action@v6
31+
with:
32+
platforms: linux/amd64
33+
tags: |
34+
twirapp/postgres:latest
35+
registry.twir.app/twirapp/postgres:latest
36+
push: true
37+
cache-from: type=gha
38+
cache-to: type=gha,mode=max

.idea/modules.xml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/postgres.iml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/workspace.xml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Dockerfile

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
ARG postgresql_major=17
2+
ARG postgresql_release=${postgresql_major}.4
3+
ARG pgx_ulid_release=0.2.0
4+
5+
FROM postgres:${postgresql_release} as base
6+
ARG postgresql_major
7+
8+
FROM base as pgx_ulid
9+
ARG pgx_ulid_release
10+
ADD "https://github.com/pksunkara/pgx_ulid/releases/download/v${pgx_ulid_release}/pgx_ulid-v${pgx_ulid_release}-pg${postgresql_major}-amd64-linux-gnu.deb" \
11+
/tmp/pgx_ulid.deb
12+
13+
FROM scratch as extensions
14+
COPY --from=pgx_ulid /tmp/*.deb /tmp/
15+
16+
####################
17+
# Build final image
18+
####################
19+
FROM base as production
20+
21+
# Setup extensions
22+
COPY --from=extensions /tmp /tmp
23+
24+
RUN apt-get update && apt-get install -y --no-install-recommends \
25+
/tmp/*.deb \
26+
&& rm -rf /var/lib/apt/lists/* /tmp/*

README.md

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
Example configuration for server:
2+
3+
4+
```
5+
# DB Version: 17
6+
# OS Type: linux
7+
# DB Type: web
8+
# Total Memory (RAM): 6 GB
9+
# CPUs num: 3
10+
# Connections num: 1000
11+
# Data Storage: ssd
12+
13+
max_connections = 1000
14+
shared_buffers = 1536MB
15+
effective_cache_size = 4608MB
16+
maintenance_work_mem = 384MB
17+
checkpoint_completion_target = 0.9
18+
wal_buffers = 16MB
19+
default_statistics_target = 100
20+
random_page_cost = 1.1
21+
effective_io_concurrency = 200
22+
work_mem = 786kB
23+
huge_pages = off
24+
min_wal_size = 1GB
25+
max_wal_size = 4GB
26+
```
27+
28+
Cli representation of configuration:
29+
30+
```bash
31+
postgres -c max_connections=1000 -c shared_buffers=1536MB -c effective_cache_size=4608MB -c maintenance_work_mem=384MB -c checkpoint_completion_target=0.9 -c wal_buffers=16MB -c default_statistics_target=100 -c random_page_cost=1.1 -c effective_io_concurrency=200 -c work_mem=786kB -c huge_pages=off -c min_wal_size=1GB -c max_wal_size=4GB
32+
```

0 commit comments

Comments
 (0)