Sign inSign up

ranur/codeigniter

By ranur

•Updated about 2 years ago

ini adalah repo pengembangan untuk Ci3 turunan dari bitnami/codeigniter:3.1.11-debian-10-r446

Image
Developer tools
Web servers
Databases & storage
0

537

ranur/codeigniter repository overview

⁠CodeIgniter Docker Image: ranur/codeigniter:3.19-php8.3-nginx

This repository provides a Docker image for running CodeIgniter with PHP 8.3 and NGINX. It includes support for SSH, Composer, and several key PHP extensions to streamline the development and deployment of your CodeIgniter applications.


⁠Table of Contents


⁠Features

  • PHP 8.3 with FPM and NGINX for high performance.
  • Pre-installed PHP extensions:
    • intl for internationalization support.
    • pdo_mysql and mysqli for database interaction.
    • xsl for XSLT processing.
  • Composer for managing PHP dependencies.
  • SSH access with root login enabled for easier debugging.
  • Supervisor for process management (NGINX, SSH).
  • Custom startup script for service initialization.

⁠Prerequisites

Before running this image, ensure that you have Docker installed. You will also need Docker Compose to run the container stack. Download it here:


⁠How to Run

To run the image ranur/codeigniter:3.19-php8.3-nginx, follow these steps:

⁠1. Pull the Docker Image
docker pull ranur/codeigniter:3.19-php8.3-nginx
⁠2. Run with Docker Compose

You can use the following docker-compose.yml configuration to run the container. See the next section for the full file.

In the same directory as your docker-compose.yml, run:

docker-compose up

⁠Docker Compose Configuration

Create a docker-compose.yml file with the following content:

version: "3.7"
services:
  web: 
    image: ranur/codeigniter:3.19-php8.3-nginx
    ports:
      - "8009:80"   # Web server accessible on port 8009
      - "8010:8080" # (optional) another NGINX server port
      - "412:22"    # SSH port for remote access
    container_name: node2_php8

This configuration exposes:

  • Port 8009: Access the web application via http://localhost:8009/.
  • Port 8010: An additional web port, accessible via http://localhost:8010/.
  • Port 412: SSH port, allowing you to access the container via SSH.

⁠Dockerfile Explanation

Here’s the Dockerfile used to build this image:

FROM dwchiang/nginx-php-fpm:8.2.10-fpm-alpine3.17-nginx-1.24.0

# Update and install required packages: OpenSSH, Git, and ICU library for PHP intl extension
RUN apk update && apk add --no-cache \
    openssh \
    git \
    icu-dev libxslt-dev && \
    mkdir /var/run/sshd && \
    echo 'root:Simop0@@@' | chpasswd && \
    sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config && \
    sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config

# Install PHP intl extension, PDO MySQL, MySQLi, and XSL
RUN docker-php-ext-configure intl && \
    docker-php-ext-install intl pdo_mysql mysqli xsl

# Install Composer
RUN apk add --no-cache bash curl && \
    curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

# Verify Composer installation
RUN composer --version

# Expose necessary ports (SSH and HTTP)
EXPOSE 22 80

# Copy application to the appropriate directory
COPY /publish/. /var/www/html/public

# Setup Supervisor
RUN mkdir -p /etc/supervisor/conf.d
COPY supervisord/supervisord.conf /etc/supervisor/supervisord.conf
COPY supervisord/sshd.conf /etc/supervisor/conf.d/sshd.conf
COPY supervisord/nginx.conf /etc/nginx/conf.d/default.conf

# Set working directory to the application's public folder
WORKDIR /var/www/html/public

# Copy start.sh script and grant execute permission
COPY start.sh /start.sh
RUN chmod +x /start.sh

# Run start.sh when the container starts
CMD ["/start.sh"]

This Dockerfile installs essential services like OpenSSH, Git, and Composer, and configures necessary PHP extensions for the smooth operation of your CodeIgniter app.


⁠Accessing the Application

Once the container is running, you can access the application using the following URL in your browser:

  • http://localhost:8009/

Make sure you’ve mapped the ports correctly in your Docker Compose file to allow external access.


⁠Accessing the Container via SSH

To access the container using SSH (optional for debugging or maintenance), use the following command:

ssh root@localhost -p 412

The default root password is: Simop0@@@

You can change this password in the Dockerfile if needed for production use.


⁠Notes

  • Make sure to configure your own docker-compose.yml and adjust the ports and volumes as necessary for your environment.
  • This image is designed for development and testing purposes. For production deployments, consider using more secure configurations for SSH and environment variables.


This `README.md` provides clear instructions on how to run the new version of the Docker image, along with detailed explanations of the Dockerfile and Docker Compose setup. You can modify it further to fit your specific needs.

Tag summary

Content type

Image

Digest

sha256:d22e76167…

Size

80.5 MB

Last updated

about 2 years ago

docker pull ranur/codeigniter:3.19-php8.3-nginx