Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 20 additions & 6 deletions .scripts/docker-build-and-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,24 @@ version="${1:?version argument is required}"

export COMPTASSE_VERSION="$version"

docker compose -f .workflows/build/compose.yml build comptasse
docker compose -f .workflows/build/compose.yml build api dashboard website

# All-in-one image (dashboard + API + CLI), used by https://comptasse.com/install.sh
docker tag "comptasse/comptasse:${version}" "${IMAGE_PREFIX}/comptasse:${version}"
docker tag "${IMAGE_PREFIX}/comptasse:${version}" "${IMAGE_PREFIX}/comptasse:latest"
docker push "${IMAGE_PREFIX}/comptasse:${version}"
docker push "${IMAGE_PREFIX}/comptasse:latest"
# API image
docker tag "comptasse-api:${version}" "${IMAGE_PREFIX}/api:${version}"
docker tag "${IMAGE_PREFIX}/api:${version}" "${IMAGE_PREFIX}/api:latest"
docker push "${IMAGE_PREFIX}/api:${version}"
docker push "${IMAGE_PREFIX}/api:latest"

# Dashboard image
docker tag "comptasse-dashboard:${version}" "${IMAGE_PREFIX}/dashboard:${version}"
docker tag "${IMAGE_PREFIX}/dashboard:${version}" "${IMAGE_PREFIX}/dashboard:latest"
docker push "${IMAGE_PREFIX}/dashboard:${version}"
docker push "${IMAGE_PREFIX}/dashboard:latest"

# Website image
docker tag "comptasse-website:${version}" "${IMAGE_PREFIX}/website:${version}"
docker tag "${IMAGE_PREFIX}/website:${version}" "${IMAGE_PREFIX}/website:latest"
docker push "${IMAGE_PREFIX}/website:${version}"
docker push "${IMAGE_PREFIX}/website:latest"

echo "Published ${IMAGE_PREFIX}/{api,dashboard,website}:${version} (+ latest)"
103 changes: 0 additions & 103 deletions .workflows/build/Dockerfile

This file was deleted.

45 changes: 29 additions & 16 deletions .workflows/build/compose.example.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# ==============================================================================
# Comptasse Full Stack (Example)
# Comptasse Self-Hosted Stack (Example)
# ==============================================================================
# Complete stack with bundled PostgreSQL and RustFS (S3-compatible storage).
# For users who want a ready-to-use setup without external infrastructure.
# API + Dashboard with bundled PostgreSQL and RustFS (S3-compatible storage).
# The website is hosted by the maintainers and is not part of self-hosted
# installs; the CLI is downloaded from GitHub Releases.
#
# Usage:
# docker compose -f .workflows/build/compose.example.yml up -d
Expand All @@ -12,36 +13,48 @@
# ==============================================================================

services:
comptasse:
image: comptasse/comptasse:${COMPTASSE_VERSION:-dev}
api:
image: comptasse-api:${COMPTASSE_VERSION:-dev}
container_name: comptasse-api
ports:
- "${API_PORT:-3000}:3000"
- "${DASHBOARD_PORT:-5173}:5173"
volumes:
- comptasse-data:/data
environment:
ENV: production
VERBOSE: "false"
PORT: "3000"
CORS_ORIGIN: ${CORS_ORIGIN:-http://localhost:5173}
COOKIES_DOMAIN: localhost
COOKIES_KEY: ${COOKIES_KEY:?COOKIES_KEY is required}
API_BASE_URL: ${API_BASE_URL:-http://localhost:3000}
WEBSITE_BASE_URL: ${WEBSITE_BASE_URL:-https://comptasse.com}
DASHBOARD_BASE_URL: ${DASHBOARD_BASE_URL:-http://localhost:5173}
SQL_DATABASE_URL: postgres://postgres:password@postgres:5432/comptasse
STORAGE_ENDPOINT: http://rustfs:9000
STORAGE_BUCKET_NAME: comptasse-files
STORAGE_ACCESS_KEY: admin
STORAGE_SECRET_KEY: admin
STORAGE_REGION: fr-par
COOKIES_DOMAIN: localhost
CORS_ORIGIN: "*"
API_BASE_URL: http://localhost:3000
WEBSITE_BASE_URL: http://localhost:5173
DASHBOARD_BASE_URL: http://localhost:5173
depends_on:
postgres:
condition: service_healthy
rustfs:
condition: service_started
restart: unless-stopped

dashboard:
image: comptasse-dashboard:${COMPTASSE_VERSION:-dev}
container_name: comptasse-dashboard
ports:
- "${DASHBOARD_PORT:-5173}:80"
depends_on:
- api
restart: unless-stopped

postgres:
image: postgres:18.1
container_name: comptasse-postgres
volumes:
- postgres-data:/var/lib/postgresql/data
- postgres-data:/var/lib/postgresql
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
Expand All @@ -55,6 +68,7 @@ services:

rustfs:
image: rustfs/rustfs:latest
container_name: comptasse-rustfs
volumes:
- rustfs-data:/data
environment:
Expand All @@ -65,6 +79,5 @@ services:
restart: unless-stopped

volumes:
comptasse-data:
postgres-data:
rustfs-data:
rustfs-data:
22 changes: 16 additions & 6 deletions .workflows/build/compose.start.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ services:
POSTGRES_PASSWORD: admin
POSTGRES_DB: default
ports:
- "5432:5432"
- "${PROD_POSTGRES_PORT:-5432}:5432"
volumes:
- postgres_data:/var/lib/postgresql
healthcheck:
Expand All @@ -44,8 +44,8 @@ services:
RUSTFS_SECRET_KEY: rustfsadmin
RUSTFS_VOLUMES: /data
ports:
- "9000:9000"
- "9001:9001"
- "${PROD_STORAGE_PORT:-9000}:9000"
- "${PROD_STORAGE_UI_PORT:-9001}:9001"
volumes:
- rustfs_data:/data
init: true
Expand All @@ -65,26 +65,36 @@ services:
ports:
- "3000:3000"
environment:
ENV: development
ENV: production
VERBOSE: "false"
PORT: "3000"
CORS_ORIGIN: http://localhost:5173
COOKIES_DOMAIN: localhost
COOKIES_KEY: development-secret-key-change-in-production-min-32-chars
API_BASE_URL: http://localhost:3000
WEBSITE_BASE_URL: http://localhost:5173
DASHBOARD_BASE_URL: http://localhost:5174
SQL_DATABASE_URL: postgres://postgres:admin@postgres:5432/default
STORAGE_ENDPOINT: http://rustfs:9000

STORAGE_BUCKET_NAME: comptasse-files
STORAGE_ACCESS_KEY: rustfsadmin
STORAGE_SECRET_KEY: rustfsadmin
STORAGE_REGION: fr-par
MOLLIE_API_KEY: test_z8gjjnezmRNx7dretKbEr5vcCfADh9
depends_on:
postgres:
condition: service_healthy
rustfs:
condition: service_healthy

dashboard:
container_name: comptasse-prod-dashboard
image: comptasse-dashboard:${COMPTASSE_VERSION:-dev}
ports:
- "5174:80"
depends_on:
- api

website:
container_name: comptasse-prod-website
image: comptasse-website:${COMPTASSE_VERSION:-dev}
Expand All @@ -93,4 +103,4 @@ services:

volumes:
postgres_data:
rustfs_data:
rustfs_data:
63 changes: 47 additions & 16 deletions .workflows/build/compose.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,75 @@
# ==============================================================================
# Comptasse Build Compose
# ==============================================================================
# Builds the all-in-one Docker image containing API + Dashboard + CLI.
# Builds the three production Docker images: api, dashboard, website.
#
# Usage:
# docker compose -f .workflows/build/compose.yml build
# docker compose -f .workflows/build/compose.yml up -d
#
# Required environment variables:
# Required environment variables (runtime):
# SQL_DATABASE_URL - PostgreSQL connection string
# STORAGE_ENDPOINT - S3-compatible storage endpoint
# STORAGE_BUCKET_NAME - Storage bucket name
# STORAGE_ACCESS_KEY - Storage access key
# STORAGE_SECRET_KEY - Storage secret key
#
# Build arguments (dashboard/website):
# VITE_API_BASE_URL default /api
# VITE_WEBSITE_BASE_URL default empty
# VITE_DASHBOARD_BASE_URL default empty
# ==============================================================================

services:
comptasse:
image: comptasse/comptasse:${COMPTASSE_VERSION:-dev}
api:
image: comptasse-api:${COMPTASSE_VERSION:-dev}
build:
context: ../..
dockerfile: .workflows/build/Dockerfile
dockerfile: .workflows/build/packages/api/Dockerfile
ports:
- "${API_PORT:-3000}:3000"
- "${DASHBOARD_PORT:-5173}:5173"
volumes:
- comptasse-data:/data
environment:
ENV: ${ENV:-production}
VERBOSE: ${VERBOSE:-false}
PORT: "${API_PORT:-3000}"
CORS_ORIGIN: ${CORS_ORIGIN:-localhost}
COOKIES_DOMAIN: ${COOKIES_DOMAIN:-localhost}
COOKIES_KEY: ${COOKIES_KEY:-}
API_BASE_URL: ${API_BASE_URL:-http://localhost:3000}
WEBSITE_BASE_URL: ${WEBSITE_BASE_URL:-http://localhost:5173}
DASHBOARD_BASE_URL: ${DASHBOARD_BASE_URL:-http://localhost:5173}
SQL_DATABASE_URL: ${SQL_DATABASE_URL:-postgres://postgres:password@postgres:5432/comptasse}
STORAGE_ENDPOINT: ${STORAGE_ENDPOINT:-http://rustfs:9000}
STORAGE_BUCKET_NAME: ${STORAGE_BUCKET_NAME:-comptasse-files}
STORAGE_ACCESS_KEY: ${STORAGE_ACCESS_KEY:-placeholder}
STORAGE_SECRET_KEY: ${STORAGE_SECRET_KEY:-placeholder}
STORAGE_REGION: ${STORAGE_REGION:-fr-par}
COOKIES_KEY: ${COOKIES_KEY:-}
COOKIES_DOMAIN: ${COOKIES_DOMAIN:-localhost}
CORS_ORIGIN: ${CORS_ORIGIN:-*}
API_BASE_URL: ${API_BASE_URL:-http://localhost:3000}
WEBSITE_BASE_URL: ${WEBSITE_BASE_URL:-http://localhost:5173}
DASHBOARD_BASE_URL: ${DASHBOARD_BASE_URL:-http://localhost:5173}
restart: unless-stopped

volumes:
comptasse-data:
dashboard:
image: comptasse-dashboard:${COMPTASSE_VERSION:-dev}
build:
context: ../..
dockerfile: .workflows/build/packages/dashboard/Dockerfile
args:
VITE_API_BASE_URL: ${VITE_API_BASE_URL:-/api}
VITE_WEBSITE_BASE_URL: ${VITE_WEBSITE_BASE_URL:-}
VITE_DASHBOARD_BASE_URL: ${VITE_DASHBOARD_BASE_URL:-}
ports:
- "${DASHBOARD_PORT:-5173}:80"
depends_on:
- api
restart: unless-stopped

website:
image: comptasse-website:${COMPTASSE_VERSION:-dev}
build:
context: ../..
dockerfile: .workflows/build/packages/website/Dockerfile
args:
VITE_WEBSITE_BASE_URL: ${VITE_WEBSITE_BASE_URL:-}
VITE_API_BASE_URL: ${VITE_API_BASE_URL:-}
VITE_DASHBOARD_BASE_URL: ${VITE_DASHBOARD_BASE_URL:-}
ports:
- "${WEBSITE_PORT:-8080}:80"
restart: unless-stopped
Loading
Loading