Operation
This page outlines how to successfully operate the application
Configuration Pre-Requisites
You will first need to create a .env file as described in the Configuration Guide
Operation Using Docker
Docker is used to build, deploy, and manage applications within isolated, lightweight containers, effectively packaging an application with all its dependencies so it can run consistently across different environments, allowing for faster development, testing, and deployment of software.
We use it to simplify installation
Prerequisites
Follow these steps to install Docker on your system:
-
The steps are different for Windows/Mac versus Linux users:
-
You must ensure that docker is running for the Talawa-Admin application to work correctly.
The next steps will depend on whether you are:
- an end user installing our software (Production Environments) or
- one of our open source contributors (Development Environments).
Please follow them closely.
For Production Environments
This section describes how to setup the application in a production environment.
- Configure
nginx.conffile located atconfig/docker/setup. Modify it to fit your preferences before running the application.
Starting The Application
To start the application you will need to build, then run the Docker Image. These steps follow:
-
Windows Systems:
-
Run the following command to first build the Docker image:
docker-compose -f docker/docker-compose.prod.yaml build -
Run the following command to run the Docker image:
docker-compose -f docker/docker-compose.prod.yaml --env-file .env up -dFor troubleshooting purposes, you can run docker in interactive mode to directly see the logs by removing the
-dat the end. -
The application will be accessible at
http://localhost:4321
-
-
Linux Systems:
-
Run the following command to first build the Docker image:
docker compose -f docker/docker-compose.prod.yaml build -
Run the following command to run the Docker image:
docker compose -f docker/docker-compose.prod.yaml --env-file .env up -dFor troubleshooting purposes, you can run docker in interactive mode to directly see the logs by removing the
-dat the end. -
The application will be accessible at
http://localhost:4321
-
-
Linux Systems (Rootless Docker - Optional):
-
Set
DOCKER_HOSTdynamically (do not hardcode UID):export DOCKER_HOST=unix:///run/user/$UID/docker.sockOr run:
eval "$(./scripts/docker/resolve-docker-host.sh --mode rootless --emit-export --warn-if-docker-group)" -
Build using the rootless compose file:
docker compose -f docker/docker-compose.rootless.prod.yaml build -
Start the app:
docker compose -f docker/docker-compose.rootless.prod.yaml --env-file .env up -d
-
Stopping The Application
To stop the container run the following command:
-
Windows Systems: Run the following command to stop the Docker image:
docker-compose -f docker/docker-compose.prod.yaml down -
Linux Systems: Run the following command to stop the Docker image:
docker compose -f docker/docker-compose.prod.yaml down -
Linux Systems (Rootless Docker - Optional): Run:
docker compose -f docker/docker-compose.rootless.prod.yaml down
For Development Environments
This section describes how to setup the application in a development environment.
Starting The Application
To start the application you will need to build, then run the Docker Image. These steps follow:
-
Windows Systems:
-
Run the following command to first build the Docker image:
docker-compose -f docker/docker-compose.dev.yaml build -
Run the following command to run the Docker image:
docker-compose -f docker/docker-compose.dev.yaml --env-file .env up -dFor troubleshooting purposes, you can run docker in interactive mode to directly see the logs by removing the
-dat the end. -
The application will be accessible at
http://localhost:4321
-
-
Linux Systems:
-
Run the following command to first build the Docker image:
docker compose -f docker/docker-compose.dev.yaml build -
Run the following command to run the Docker image:
docker compose -f docker/docker-compose.dev.yaml --env-file .env up -dFor troubleshooting purposes, you can run docker in interactive mode to directly see the logs by removing the
-dat the end. -
The application will be accessible at
http://localhost:4321
-
-
Linux Systems (Rootless Docker - Optional):
-
Set
DOCKER_HOSTdynamically:export DOCKER_HOST=unix:///run/user/$UID/docker.sockOr run:
eval "$(./scripts/docker/resolve-docker-host.sh --mode rootless --emit-export --warn-if-docker-group)" -
Build rootless development image:
docker compose -f docker/docker-compose.rootless.dev.yaml build -
Start rootless development container:
docker compose -f docker/docker-compose.rootless.dev.yaml --env-file .env up -d
-
Stopping The Application
To stop the container run the following command:
-
Windows Systems: Run the following command to stop the Docker image:
docker-compose -f docker/docker-compose.dev.yaml down -
Linux Systems: Run the following command to stop the Docker image:
docker compose -f docker/docker-compose.dev.yaml down -
Linux Systems (Rootless Docker - Optional): Run:
docker compose -f docker/docker-compose.rootless.dev.yaml down
Operation Without Docker
If you are running Talawa-Admin natively then the next steps will depend on whether you are:
- an end user installing our software (Production Environments) or
- one of our open source contributors (Development Environments).
Please follow them closely.
For Production Environments
Follow these steps if you are running the app in a production environment without Docker.
Starting The Application
Run the following command to start the production server:
pnpm run serve &
Stopping The Application
Since the production server runs in the background, you need to find and stop the process:
-
Find the process ID:
pgrep -f "pnpm run serve" -
Stop the process using the process ID from step 1:
kill <process_id>Replace
<process_id>with the actual process ID number.
Alternatively, you can use a single command:
pkill -f "pnpm run serve"
Rootless Troubleshooting
If Docker rootless mode fails to start, check the following:
- Socket mismatch (
/var/run/docker.sockvs/run/user/$UID/docker.sock)- Ensure
DOCKER_HOSTis set dynamically:export DOCKER_HOST=unix:///run/user/$UID/docker.sock - Or run:
eval "$(./scripts/docker/resolve-docker-host.sh --mode rootless --emit-export --warn-if-docker-group)"
- Ensure
dockerd-rootless-setuptool.shrun with sudo- Re-run as your regular user (no
sudo):dockerd-rootless-setuptool.sh install
- Re-run as your regular user (no
mkdir /var/run/docker.sock: file exists- This usually indicates a rootful/rootless context mix.
- Stop containers, verify
DOCKER_HOST, then restart with the intended compose file.
For Development Environments
Follow these steps if you are running the app in a development environment without Docker.
Starting The Application
Run the following command to start the development server:
pnpm run serve
The app will run until you hit:
<CTRL-C>