Running with Docker
Relevant source files
The following files were used as context for generating this wiki page:The Ever Teams platform is designed to be run using Docker, providing a consistent and isolated environment for development, demonstration, and production. The repository includes multiple Docker configurations to cater to different use cases, from a quick demo to a full production-like setup or a local development environment with hot-reloading.
By default, the Ever Teams web frontend connects to the production Ever Gauzy API endpoint at https://api.ever.team. This can be overridden for self-hosting by setting the GAUZY_API_SERVER_URL and NEXT_PUBLIC_GAUZY_API_SERVER_URL environment variables.
Sources: README.md:83-85, README.md:111-114
Docker Compose Configurations
The project utilizes Docker Compose to manage multi-container application environments. Different docker-compose files are provided for various scenarios.
Sources: README.md:65-67
Docker Compose File Comparison
This table summarizes the purpose of each Docker Compose file.
| File | Purpose | Image Source | Key Feature |
|---|---|---|---|
docker-compose.demo.yml | Quick demo/exploration | Pre-built from ghcr.io | Basic configuration, fastest startup. |
docker-compose.yml | Production-like environment | Pre-built from ghcr.io | Includes api and other infrastructure services. |
docker-compose.build.yml | Build and run from source | Builds image locally | Builds the webapp image from the local Dockerfile. |
docker-compose.dev.yml | Local development | Builds dev image locally | Hot-reloading with mounted source code volumes. |
Sources: README.md:68-78, docker-run.sh:30-35
Production Configuration (docker-compose.yml)
This configuration is intended for a full production setup. It defines two main services: api and webapp, along with their dependencies on infrastructure services defined in docker-compose.infra.yml.
The diagram below illustrates the service dependencies for the production environment.
Sources: docker-compose.yml:4-177
webapp Service
The webapp service runs the Next.js frontend application. It uses the pre-built ghcr.io/ever-co/ever-teams-webapp:latest image.
Key aspects:
- Container Name:
webapp - Image:
ghcr.io/ever-co/ever-teams-webapp:latest - Port Mapping: Exposes port
3030on the host. - Dependencies: Depends on
db,redis,minio,elasticsearch, andapiservices being started.
Sources: docker-compose.yml:82-84, docker-compose.yml:175-176, docker-compose.yml:165-174
api Service
The api service runs the backend, which is based on the Ever Gauzy platform. It uses the pre-built ghcr.io/ever-co/gauzy-api:latest image.
Key aspects:
- Container Name:
api - Image:
ghcr.io/ever-co/gauzy-api:latest - Port Mapping: Exposes port
3000. - Dependencies: Depends on
db,zipkin,redis,minio,elasticsearch, andcube.
Sources: docker-compose.yml:5-7, docker-compose.yml:76-77, docker-compose.yml:59-75
Demo Configuration (docker-compose.demo.yml)
This file is for running the platform in a basic configuration for demonstration purposes. It only defines the webapp service and relies on pre-built Docker images, making it the fastest way to get started. It uses .env.demo.compose for environment variables.
# docker-compose.demo.yml
services:
webapp:
container_name: webapp
image: ghcr.io/ever-co/ever-teams-webapp:latest
environment:
GAUZY_API_SERVER_URL: ${GAUZY_API_SERVER_URL:-https://api.ever.team}
NEXT_PUBLIC_GAUZY_API_SERVER_URL: ${NEXT_PUBLIC_GAUZY_API_SERVER_URL:-https://api.ever.team}
NODE_ENV: ${NODE_ENV:-development}
NEXT_PUBLIC_DEMO: "true"
# ... other branding and config variables
env_file:
- .env.demo.compose
restart: on-failure
ports:
- "3030:${UI_PORT:-3030}"
networks:
- overlay
Sources: README.md:68-71, docker-compose.demo.yml:2-80
Local Build Configuration (docker-compose.build.yml)
This configuration is used to build the webapp Docker image from the local source code using the Dockerfile in the root directory. It is useful for creating a production-like image based on local changes.
# docker-compose.build.yml
services:
webapp:
container_name: webapp
image: ever-teams-webapp:latest
build:
context: .
dockerfile: Dockerfile
args:
GAUZY_API_SERVER_URL: ${GAUZY_API_SERVER_URL:-https://api.ever.team}
# ... other build arguments
ports:
- '3030:${UI_PORT:-3030}'
Sources: README.md:75-78, docker-compose.build.yml:2-10
Development Configuration (docker-compose.dev.yml)
This file is tailored for local development and enables hot-reloading. It builds a development-specific image (ever-teams-webapp:dev) using Dockerfile.dev.
Key features:
- Hot Reload: Source code directories (
apps/web,packages, config files) are mounted as volumes into the container. - Polling:
CHOKIDAR_USEPOLLINGandWATCHPACK_POLLINGare set totrueto ensure file changes are detected within the Docker volume. - Healthcheck: A healthcheck is configured to verify that the Next.js development server is running on port
3030.
# docker-compose.dev.yml
services:
webapp-dev:
container_name: webapp-dev
image: ever-teams-webapp:dev
build:
context: .
dockerfile: Dockerfile.dev
environment:
# Enable polling for hot reload in Docker
CHOKIDAR_USEPOLLING: "true"
WATCHPACK_POLLING: "true"
volumes:
- ./apps/web:/app/apps/web
- ./packages:/app/packages
# ... other mounted files
- /app/apps/web/.next # Exclude .next directory
Sources: docker-compose.dev.yml:1-111
Docker Management Script (docker-run.sh)
The docker-run.sh script simplifies the management of Docker containers for both production and development modes. It acts as a wrapper around docker-compose commands, using the appropriate configuration files for each environment.
Sources: docker-run.sh:1-15
The following flowchart shows the logic of the script based on the command provided.
Sources: docker-run.sh:252-299
Available Commands
The script provides a set of commands to manage the application lifecycle.
| Command | Mode | Description | Source File Reference |
|---|---|---|---|
build | Production | Builds the production Docker image using docker-compose.build.yml. | docker-run.sh:123-127 |
start | Production | Starts the application in detached mode using docker-compose.build.yml. | docker-run.sh:130-136 |
restart | Production | Stops and then starts the production containers. | docker-run.sh:144-148 |
logs | Production | Tails the logs of the production webapp container. | docker-run.sh:151-154 |
dev | Development | Starts the application in development mode with hot-reloading. | docker-run.sh:167-173 |
dev:build | Development | Builds the development Docker image using docker-compose.dev.yml. | docker-run.sh:161-165 |
dev:logs | Development | Tails the logs of the development webapp-dev container. | docker-run.sh:176-179 |
stop | Global | Stops all running containers for both production and development. | docker-run.sh:138-142 |
clean | Global | Prompts the user to remove all containers and images for both environments. | docker-run.sh:185-201 |
help | Global | Displays the help message with all available commands. | docker-run.sh:207-250 |
Sources: docker-run.sh:10-24, docker-run.sh:210-230
Standalone Docker Usage
In addition to Docker Compose, the application can be run as a standalone Docker container.
Using Public Images
A pre-built public image is available on Docker Hub.
- Pull the image:
docker pull everco/ever-teams-webapp - Run the container:
docker run -p 127.0.0.1:3030:3030/tcp everco/ever-teams-webapp
The application will be accessible at http://localhost:3030.
Sources: README.md:89-93
Building and Running Locally
You can also build the image from the source code and run it locally.
- Build the image:
docker build . -t ever-teams-webapp -f Dockerfile - Run the container:
docker run -p 127.0.0.1:3030:3030/tcp ever-teams-webapp
Sources: README.md:98-102
Docker Images
Official Docker images for Ever Teams are published to two locations:
- Docker Hub: hub.docker.com/u/everco
- GitHub Packages: github.com/orgs/ever-co/packages
The production image ghcr.io/ever-co/ever-teams-webapp:latest is used in deployment templates for services like Northflank.