Skip to content

Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.

Refactor postgres docker setup and update docs (#190)

Leendert de Borst17e4f614d89d
diff --git a/.github/workflows/publish-docker-images.yml b/.github/workflows/publish-docker-images.yml
index a97f950aa..4dee4a89a 100644
--- a/.github/workflows/publish-docker-images.yml
+++ b/.github/workflows/publish-docker-images.yml
@@ -38,6 +38,14 @@ jobs:
with:
images: ${{ env.REGISTRY }}/${{ env.REPO_LOWER }}
+ - name: Build and push Postgres image
+ uses: docker/build-push-action@v5
+ with:
+ context: .
+ file: src/Databases/AliasServerDb/Dockerfile
+ push: true
+ tags: ${{ env.REGISTRY }}/${{ env.REPO_LOWER }}-postgres:latest,${{ env.REGISTRY }}/${{ env.REPO_LOWER }}-postgres:${{ github.ref_name }}
+
- name: Build and push API image
uses: docker/build-push-action@v5
with:
@@ -62,6 +70,14 @@ jobs:
push: true
tags: ${{ env.REGISTRY }}/${{ env.REPO_LOWER }}-admin:latest,${{ env.REGISTRY }}/${{ env.REPO_LOWER }}-admin:${{ github.ref_name }}
+ - name: Build and push Reverse Proxy image
+ uses: docker/build-push-action@v5
+ with:
+ context: .
+ file: Dockerfile
+ push: true
+ tags: ${{ env.REGISTRY }}/${{ env.REPO_LOWER }}-reverse-proxy:latest,${{ env.REGISTRY }}/${{ env.REPO_LOWER }}-reverse-proxy:${{ github.ref_name }}
+
- name: Build and push SMTP image
uses: docker/build-push-action@v5
with:
@@ -78,14 +94,6 @@ jobs:
push: true
tags: ${{ env.REGISTRY }}/${{ env.REPO_LOWER }}-task-runner:latest,${{ env.REGISTRY }}/${{ env.REPO_LOWER }}-task-runner:${{ github.ref_name }}
- - name: Build and push Reverse Proxy image
- uses: docker/build-push-action@v5
- with:
- context: .
- file: Dockerfile
- push: true
- tags: ${{ env.REGISTRY }}/${{ env.REPO_LOWER }}-reverse-proxy:latest,${{ env.REGISTRY }}/${{ env.REPO_LOWER }}-reverse-proxy:${{ github.ref_name }}
-
- name: Build and push InstallCli image
uses: docker/build-push-action@v5
with:
diff --git a/docker-compose.build.yml b/docker-compose.build.yml
index cd1382bf4..bf873e9cf 100644
--- a/docker-compose.build.yml
+++ b/docker-compose.build.yml
@@ -1,9 +1,9 @@
services:
- reverse-proxy:
- image: aliasvault-reverse-proxy
+ postgres:
+ image: aliasvault-postgres
build:
context: .
- dockerfile: Dockerfile
+ dockerfile: src/Databases/AliasServerDb/Dockerfile
client:
image: aliasvault-client
@@ -23,6 +23,12 @@ services:
context: .
dockerfile: src/AliasVault.Admin/Dockerfile
+ reverse-proxy:
+ image: aliasvault-reverse-proxy
+ build:
+ context: .
+ dockerfile: Dockerfile
+
smtp:
image: aliasvault-smtp
build:
@@ -34,9 +40,3 @@ services:
build:
context: .
dockerfile: src/Services/AliasVault.TaskRunner/Dockerfile
-
- postgres:
- image: aliasvault-postgres
- build:
- context: .
- dockerfile: Dockerfile.postgres
diff --git a/docker-compose.yml b/docker-compose.yml
index 220e5cb09..c4f553e4e 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -1,21 +1,17 @@
services:
- reverse-proxy:
- image: ghcr.io/lanedirt/aliasvault-reverse-proxy:latest
- ports:
- - "${HTTP_PORT:-80}:80"
- - "${HTTPS_PORT:-443}:443"
+ postgres:
+ image: ghcr.io/lanedirt/aliasvault-postgres:latest
volumes:
- - ./certificates/ssl:/etc/nginx/ssl:rw
- - ./certificates/letsencrypt:/etc/nginx/ssl-letsencrypt:rw
- - ./certificates/letsencrypt/www:/var/www/certbot:rw
- depends_on:
- - admin
- - client
- - api
- - smtp
- restart: always
+ - ./database/postgres:/var/lib/postgresql/data:rw
env_file:
- .env
+ restart: always
+ healthcheck:
+ test: ["CMD-SHELL", "pg_isready -U aliasvault"]
+ interval: 5s
+ timeout: 5s
+ retries: 5
+ start_period: 10s
client:
image: ghcr.io/lanedirt/aliasvault-client:latest
@@ -61,6 +57,24 @@ services:
environment:
ConnectionStrings__AliasServerDbContext: "Host=postgres;Database=aliasvault;Username=aliasvault;Password=${POSTGRES_PASSWORD}"
+ reverse-proxy:
+ image: ghcr.io/lanedirt/aliasvault-reverse-proxy:latest
+ ports:
+ - "${HTTP_PORT:-80}:80"
+ - "${HTTPS_PORT:-443}:443"
+ volumes:
+ - ./certificates/ssl:/etc/nginx/ssl:rw
+ - ./certificates/letsencrypt:/etc/nginx/ssl-letsencrypt:rw
+ - ./certificates/letsencrypt/www:/var/www/certbot:rw
+ depends_on:
+ - admin
+ - client
+ - api
+ - smtp
+ restart: always
+ env_file:
+ - .env
+
smtp:
image: ghcr.io/lanedirt/aliasvault-smtp:latest
ports:
@@ -90,18 +104,4 @@ services:
postgres:
condition: service_healthy
environment:
- ConnectionStrings__AliasServerDbContext: "Host=postgres;Database=aliasvault;Username=aliasvault;Password=${POSTGRES_PASSWORD}"
-
- postgres:
- image: ghcr.io/lanedirt/aliasvault-postgres:latest
- volumes:
- - ./database/postgres:/var/lib/postgresql/data:rw
- env_file:
- - .env
- restart: always
- healthcheck:
- test: ["CMD-SHELL", "pg_isready -U aliasvault"]
- interval: 5s
- timeout: 5s
- retries: 5
- start_period: 10s
+ ConnectionStrings__AliasServerDbContext: "Host=postgres;Database=aliasvault;Username=aliasvault;Password=${POSTGRES_PASSWORD}"
\ No newline at end of file
diff --git a/docs/misc/release/create-new-release.md b/docs/misc/release/create-new-release.md
index 5fac8fabb..cc0bc68f9 100644
--- a/docs/misc/release/create-new-release.md
+++ b/docs/misc/release/create-new-release.md
@@ -10,10 +10,16 @@ nav_order: 1
Follow the steps in the checklist below to prepare a new release.
+## Versioning
- [ ] Update ./src/Shared/AliasVault.Shared.Core/AppInfo.cs and update major/minor/patch to the new version. This version will be shown in the client and admin app footer.
- [ ] Update ./install.sh `@version` in header if the install script has changed. This allows the install script to self-update when running ./install.sh update command on default installations.
-- [ ] Update README screenshots if applicable
-- [ ] Update README current/upcoming features
-Optional steps:
+## Docker Images
+If docker containers have been added or removed:
+- [ ] Verify that `publish-docker-images.yml` contains all docker images that need to be published.
+- [ ] Update `install.sh` and verify that the `images()` array that takes care of pulling the images from the GitHub Container Registry is updated.
+
+## Documentation
- [ ] Update /docs instructions if any changes have been made to the setup process
+- [ ] Update README screenshots if applicable
+- [ ] Update README current/upcoming features
diff --git a/install.sh b/install.sh
index 8893875cf..13b71261f 100755
--- a/install.sh
+++ b/install.sh
@@ -1452,6 +1452,7 @@ handle_install_version() {
printf "${CYAN}> Installing version: ${target_version}${NC}\n"
images=(
+ "${GITHUB_CONTAINER_REGISTRY}-postgres:${target_version}"
"${GITHUB_CONTAINER_REGISTRY}-reverse-proxy:${target_version}"
"${GITHUB_CONTAINER_REGISTRY}-api:${target_version}"
"${GITHUB_CONTAINER_REGISTRY}-client:${target_version}"
diff --git a/Dockerfile.postgres b/src/Databases/AliasServerDb/Dockerfile
similarity index 62%
rename from Dockerfile.postgres
rename to src/Databases/AliasServerDb/Dockerfile
index 9ccbd44cf..ee6f092c8 100644
--- a/Dockerfile.postgres
+++ b/src/Databases/AliasServerDb/Dockerfile
@@ -1,6 +1,6 @@
FROM postgres:16-alpine
# Add any custom PostgreSQL configurations if needed
-COPY postgresql.conf /etc/postgresql/postgresql.conf
+COPY src/Databases/AliasServerDb/postgresql.conf /etc/postgresql/postgresql.conf
CMD ["postgres", "-c", "config_file=/etc/postgresql/postgresql.conf"]
\ No newline at end of file
diff --git a/postgresql.conf b/src/Databases/AliasServerDb/postgresql.conf
similarity index 100%
rename from postgresql.conf
rename to src/Databases/AliasServerDb/postgresql.conf