Skip to content

PostgreSQL backup tool with Point-In-Time-Recovery and restore verification

REFACTOR (docker): Reorganize docker files to keep as single commit file

Rostislav Dugind47215006d25
diff --git a/.gitignore b/.gitignore
index d474735b..95002e1f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,8 +9,6 @@ valkey-data/
victoria-logs-data/
wal-queue/
temp/
-docker-compose.yml
-!agent/e2e/docker-compose.yml
node_modules/
.idea
/articles
diff --git a/backend/README.md b/backend/README.md
index b816647e..6657aaed 100644
--- a/backend/README.md
+++ b/backend/README.md
@@ -1,7 +1,6 @@
# Before run
> Copy .env.example to .env in the repo root (single source for backend, frontend, and docker compose)
-> Copy docker-compose.example.yml to docker-compose.yml in the repo root (for development only)
# Run
diff --git a/docker-compose.image.example.yml b/docker-compose.image.example.yml
deleted file mode 100644
index e155c6ce..00000000
--- a/docker-compose.image.example.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-version: "3"
-
-# Do not use this file in production or VPS. This
-# file is indended for local development only. To
-# run on your machine - read README.md
-
-services:
- # For local development only to test build. Do
- # not use in production or VPS
- databasus-local:
- build:
- context: .
- dockerfile: Dockerfile
- ports:
- - "4005:4005"
- volumes:
- - ./databasus-data:/databasus-data
- container_name: databasus-local
- restart: unless-stopped
\ No newline at end of file
diff --git a/docker-compose.example.yml b/docker-compose.yml
similarity index 95%
rename from docker-compose.example.yml
rename to docker-compose.yml
index 938aad5f..2b23284c 100644
--- a/docker-compose.example.yml
+++ b/docker-compose.yml
@@ -1,4 +1,23 @@
services:
+ # ================================================================
+ # Local image build (opt-in via profile)
+ # ================================================================
+
+ # For local development only to test build. This service is gated
+ # behind the "image" profile so it does NOT start with a plain
+ # `docker compose up -d`. To run: docker compose up databasus-local
+ databasus-local:
+ profiles: ["image"]
+ build:
+ context: .
+ dockerfile: Dockerfile
+ ports:
+ - "4005:4005"
+ volumes:
+ - ./databasus-data:/databasus-data
+ container_name: databasus-local
+ restart: unless-stopped
+
# ================================================================
# Backend dev services
# ================================================================
@@ -8,7 +27,7 @@ services:
backend-db:
image: postgres:17
ports:
- - "5437:5437"
+ - "${BACKEND_DB_PORT:-5437}:5432"
environment:
- POSTGRES_DB=${DEV_DB_NAME}
- POSTGRES_USER=${DEV_DB_USERNAME}
@@ -16,14 +35,13 @@ services:
volumes:
- ./pgdata:/var/lib/postgresql/data
container_name: backend-db
- command: -p 5437
shm_size: 10gb
# Dedicated test DB so `make test` doesn't pollute the dev DB
backend-db-test:
image: postgres:17
ports:
- - "5438:5438"
+ - "${BACKEND_DB_TEST_PORT:-5438}:5432"
environment:
- POSTGRES_DB=${DEV_DB_NAME}
- POSTGRES_USER=${DEV_DB_USERNAME}
@@ -31,7 +49,6 @@ services:
volumes:
- ./pgdata-test:/var/lib/postgresql/data
container_name: backend-db-test
- command: -p 5438
shm_size: 10gb
# Valkey for caching
@@ -54,7 +71,7 @@ services:
image: victoriametrics/victoria-logs:latest
container_name: backend-victoria-logs
ports:
- - "9428:9428"
+ - "${BACKEND_VICTORIA_LOGS_PORT:-9428}:9428"
command:
- -storageDataPath=/victoria-logs-data
- -retentionPeriod=7d
@@ -75,7 +92,7 @@ services:
POSTGRES_USER: devuser
POSTGRES_PASSWORD: devpassword
ports:
- - "7433:5432"
+ - "${AGENT_DB_PORT:-7433}:5432"
command:
- bash
- -c