Deployment with Docker
Relevant source files
The following files were used as context for generating this wiki page:
The Ever Gauzy platform utilizes Docker and Docker Compose to provide standardized and reproducible deployment environments for various scenarios, including quick demos, full production-like setups, and local development builds. This approach encapsulates the application services and their dependencies into containers, ensuring consistency across different machines.
The project provides multiple docker-compose files to cater to different needs. These files define the services, networks, volumes, and configurations required to run the platform. The primary services are the api (backend) and webapp (frontend), which rely on a set of infrastructure services for database, caching, storage, and more.
Sources: README.md:162-164, docker-compose.yml, docker-compose.demo.yml
Deployment Scenarios
Gauzy offers three main Docker Compose deployment scenarios, each tailored for a specific use case.
Sources: README.md:170-192
Demo Deployment
This is the simplest way to run the platform for evaluation or to explore its functionality. It uses pre-built Docker images from ghcr.io and runs a minimal set of services.
- File:
docker-compose.demo.yml - Command:
docker-compose -f docker-compose.demo.yml up - Configuration: Uses
.env.demo.composefor environment variables. - Default Credentials:
- Super Admin:
admin@ever.co/admin - Employee:
employee@ever.co/123456
- Super Admin:
The demo setup includes the core api and webapp services, along with a db (PostgreSQL) service.
This diagram illustrates the simple service architecture for the demo deployment.
Services in docker-compose.demo.yml:
| Service | Image | Purpose |
|---|---|---|
db | postgres:17-alpine | Primary database for the application. |
api | ghcr.io/ever-co/gauzy-api:latest | The backend API service. |
webapp | ghcr.io/ever-co/gauzy-webapp:latest | The frontend web application served via Nginx. |
Sources: README.md:173-179, docker-compose.demo.yml:4-13, docker-compose.demo.yml:15-20, docker-compose.demo.yml:76-81
Production Deployment
This configuration is intended for a minimal production setup and includes a comprehensive stack of infrastructure dependencies in addition to the core application services. Like the demo, it uses pre-built images.
- File:
docker-compose.yml - Command:
docker-compose up -d - Configuration: Uses
.env.composefor environment variables.
This setup includes the docker-compose.infra.yml file, which defines a wide range of backing services.
This diagram shows the full service architecture for the production deployment, including all infrastructure dependencies.
The production setup adds several infrastructure components for scalability and advanced features.
| Service | Description |
|---|---|
PostgreSQL | Primary database. |
Pgweb | Web-based client for PostgreSQL. |
OpenSearch | Search engine. |
OpenSearch Dashboards | UI for OpenSearch. |
Dejavu | Alternative Web UI for OpenSearch. |
MinIO | S3-compatible object storage. |
Jitsu | Data ingestion engine. |
Redis | In-memory cache. |
Cube | Semantic layer for BI and analytics. |
Zipkin | Distributed tracing system. |
Sources: README.md:181-184, README.md:196-210, docker-compose.yml
Local Build Deployment
This scenario is for developers who want to build the Docker images from the local source code instead of using pre-built ones.
- File:
docker-compose.build.yml - Command:
docker-compose -f docker-compose.build.yml up -d - Configuration: Uses
.env.composefor environment variables.
The api and webapp services in this file have a build section that specifies the Dockerfile and context for building the images locally.
# Source: docker-compose.build.yml:5-11
services:
api:
container_name: api
image: gauzy-api:latest
build:
context: .
dockerfile: .deploy/api/Dockerfile
args:
NODE_ENV: ${NODE_ENV:-development}
# Source: docker-compose.build.yml:81-87
webapp:
container_name: webapp
image: gauzy-webapp:latest
build:
context: .
dockerfile: .deploy/webapp/Dockerfile
args:
NODE_ENV: ${NODE_ENV:-development}
This process is significantly longer than using pre-built images because it compiles the entire platform from source.
Sources: README.md:188-192, docker-compose.build.yml:5-11,81-87
Core Application Services
The Gauzy platform is primarily composed of two services: api and webapp.
API Service (api)
The api service is the NestJS-based backend application. It handles business logic, data processing, and communication with the database and other infrastructure services.
- Image:
ghcr.io/ever-co/gauzy-api:latest(pre-built) orgauzy-api:latest(local build). - Entrypoint:
./entrypoint.compose.sh - Command:
['node', 'main.js'] - Port: Exposes port
3000.
The service depends on db, zipkin, redis, minio, opensearch, and cube to be running.
# Source: docker-compose.yml:5-73
services:
api:
container_name: api
image: ghcr.io/ever-co/gauzy-api:latest
environment:
API_HOST: ${API_HOST:-api}
API_PORT: ${API_PORT:-3000}
NODE_ENV: ${NODE_ENV:-development}
DB_HOST: db
# ... more environment variables
env_file:
- .env.compose
entrypoint: './entrypoint.compose.sh'
command: ['node', 'main.js']
restart: on-failure
depends_on:
db:
condition: service_healthy
zipkin:
condition: service_started
# ... other dependencies
ports:
- '3000:${API_PORT:-3000}'
networks:
- overlay
The API service includes numerous plugins, such as job-proposal and knowledge-base, which are managed as dependencies.
Sources: docker-compose.yml:5-73, apps/api/package.json:44-62
Web Application Service (webapp)
The webapp service is the Angular-based frontend, served by an Nginx web server. It provides the user interface for the platform.
- Image:
ghcr.io/ever-co/gauzy-webapp:latest(pre-built) orgauzy-webapp:latest(local build). - Entrypoint:
./entrypoint.compose.sh - Command:
['nginx', '-g', 'daemon off;'] - Port: Exposes port
4200.
This service depends on the api service, among others.
# Source: docker-compose.yml:75-144
webapp:
container_name: webapp
image: ghcr.io/ever-co/gauzy-webapp:latest
environment:
WEB_HOST: ${WEB_HOST:-webapp}
WEB_PORT: ${WEB_PORT:-4200}
NODE_ENV: ${NODE_ENV:-development}
API_BASE_URL: ${API_BASE_URL:-http://localhost:3000}
# ... more environment variables
entrypoint: './entrypoint.compose.sh'
command: ['nginx', '-g', 'daemon off;']
env_file:
- .env.compose
restart: on-failure
depends_on:
# ... dependencies
api:
condition: service_started
ports:
- '4200:${UI_PORT:-4200}'
networks:
- overlay
Sources: docker-compose.yml:75-144
Configuration
The Docker Compose setups are configured using environment variables. These variables are defined in .env files, which are specified in the env_file property of each service.
docker-compose.demo.ymluses.env.demo.compose.docker-compose.ymlanddocker-compose.build.ymluse.env.compose.
This allows for easy customization of ports, database credentials, API URLs, and feature flags without modifying the compose files directly.
Key Environment Variables:
| Variable | Service | Description | Default |
|---|---|---|---|
API_PORT | api | The port on which the API server listens. | 3000 |
WEB_PORT | webapp | The port on which the web application is served. | 4200 |
DB_HOST | api | The hostname of the database service. | db |
DB_NAME | db | The name of the PostgreSQL database. | gauzy |
DB_USER | db | The PostgreSQL user. | postgres |
DB_PASS | db | The PostgreSQL user's password. | gauzy_password |
API_BASE_URL | api, webapp | The public base URL for the API. | http://localhost:3000 |
CLIENT_BASE_URL | api, webapp | The public base URL for the web client. | http://localhost:4200 |
SENTRY_DSN | api, webapp | Sentry DSN for error tracking. | (empty) |
POSTHOG_KEY | api | PostHog API key for analytics. | (empty) |
JITSU_SERVER_URL | api | URL for the Jitsu data ingestion server. | (empty) |
Sources: docker-compose.demo.yml:21-23, 58-60, docker-compose.yml:18-20, 56-58, docker-compose.build.yml:12-14, 88-90
Conclusion
The Docker-based deployment for Ever Gauzy is a robust and flexible system that supports multiple use cases. By containerizing the application and its dependencies, it ensures a consistent environment for demos, production, and local development. The use of different Docker Compose files allows users to easily select the appropriate stack, from a minimal setup for a quick look to a full-featured infrastructure for production-like environments. The configuration through environment variables further enhances this flexibility, making it straightforward to adapt the deployment to specific needs.