Sign inSign up

mich43l/opensips-cp

By mich43l

Updated 10 months ago

Opensips control panel

Image
Web servers
Monitoring & observability
0

688

mich43l/opensips-cp repository overview

OpenSIPS Control Panel Docker Image

Debian OpenSips imgsize dockerautomated

Overview

This Dockerfile builds a containerized environment for the OpenSIPS Control Panel (OpenSIPS-CP) running on Debian Bookworm with Apache2 and PostgreSQL support.

Features

  • Runs Apache2 as the web server
  • Configures OpenSIPS Control Panel (version 9.3.4)
  • Uses PostgreSQL as the database backend
  • Prepares OpenSIPS-CP for database initialization
  • Automatically configures OpenSIPS-CP database parameters
  • Runs Apache in the foreground

Requirements

  • Docker
  • Docker Compose (optional)
  • PostgreSQL database instance

Environment Variables

The following environment variables are used to configure OpenSIPS-CP:

VariableDefault ValueDescription
DB_DRIVERpgsqlDatabase driver to use
PG_HOSTlocalhostPostgreSQL host
PG_PORT5432PostgreSQL port
PG_USERopensipsDatabase user
PG_PASSWORDopensipsrwDatabase password
PG_DATABASEopensipsOpenSIPS database name
OPENSIPS_IP127.0.0.1OpenSIPS instance IP address

Building the Docker Image

To build the container image:

docker build -t opensips-cp .

Running the Container

Run the container with:

docker run -d \
  --name opensips-cp \
  -e PG_HOST=your_postgresql_host \
  -e PG_USER=your_db_user \
  -e PG_PASSWORD=your_db_password \
  -e PG_DATABASE=your_db_name \
  -e OPENSIPS_IP=your_opensips_ip \
  -p 80:80 \
  opensips-cp

Mounting Volumes

To persist configuration files and data, you can mount the following volumes:

docker run -d \
  --name opensips-cp \
  -v /your/local/opensips:/etc/opensips \
  -v /your/local/apache2:/etc/apache2 \
  -v /your/local/opensips-cp:/var/www/html/opensips-cp \
  -e PG_HOST=your_postgresql_host \
  -e PG_USER=your_db_user \
  -e PG_PASSWORD=your_db_password \
  -e PG_DATABASE=your_db_name \
  -e OPENSIPS_IP=your_opensips_ip \
  -p 80:80 \
  opensips-cp

Database Initialization

The container automatically checks if the OpenSIPS-CP schema is present in the database. If not, it initializes it. Ensure that the database credentials are correctly set for successful initialization.

Logs and Debugging

To check the container logs:

docker logs -f opensips-cp

Stopping and Removing the Container

To stop the running container:

docker stop opensips-cp

To remove the container:

docker rm opensips-cp

License

This project is licensed under the MIT License.

Contributing

Contributions are welcome! Please submit pull requests for any improvements or bug fixes.

Tag summary

Content type

Image

Digest

sha256:fe491db0f

Size

377.9 MB

Last updated

over 1 year ago

docker pull mich43l/opensips-cp