This repository contains a sample application that demonstrates how to use the CodeIgniter PHP framework with a PostgreSQL database, all running within Docker containers.
- Docker
- Docker Compose
- Clone the repository to your local machine:
git clone https://github.com/bewithdhanu/Codeigniter-PostgreSQL-with-docker.git
- Navigate to the project directory:
cd Codeigniter-PostgreSQL-with-docker
- Build and start the Docker containers:
docker-compose up -d
- Install the required dependencies using Composer:
docker-compose run --rm php composer install
- Visit the application in your web browser at
http://localhost:8080
.
The application is configured to use the following environment variables:
DB_HOST
: The hostname of the PostgreSQL server.DB_PORT
: The port number of the PostgreSQL server.DB_NAME
: The name of the PostgreSQL database.DB_USER
: The username to use when connecting to the PostgreSQL database.DB_PASS
: The password to use when connecting to the PostgreSQL database.
These environment variables can be set in the docker-compose.yml
file.
This repository is licensed under the MIT License. See the LICENSE file for more information.
This repository was created by Dhanu K.
This is a basic example of how to use CodeIgniter with PostgreSQL and Docker. Feel free to use this as a starting point for your own applications!