Git Product home page Git Product logo

docker-codeigniter's Introduction

Docker + CodeIgniter 1.7.3

This image serves as a starting point for legacy CodeIgniter projects.

The CodeIgniter User Guide is served up by default if nothing has been copied or mounted to /var/www/html.

Supported Tags

Quick Start

Start a container using the latest image, mapping your local port 80 to the container's port 80:

$ docker run -p 80:80 --name codeigniter aspendigital/codeigniter:latest
# `CTRL-C` to stop
$ docker rm codeigniter  # Destroys the container

If there is a port conflict, you will receive an error message from the Docker daemon. Try mapping to an open local port (-p 8080:80) or shut down the container or server that is on the desired port.

  • Visit http://localhost using your browser.
  • Hit CTRL-C to stop the container. Running a container in the foreground will send log outputs to your terminal.

Run the container in the background by passing the -d option:

$ docker run -p 80:80 --name codeigniter -d aspendigital/codeigniter:latest
$ docker stop codeigniter  # Stops the container. To restart `docker start codeigniter`
$ docker rm codeigniter  # Destroys the container

Working with Local Files

Using Docker volumes, you can mount local files inside a container.

The CodeIgniter system folder resides in /var/www/codeigniter. You may need to update the $system_folder variable in your project's include/ci_include.php file.

The container uses the working directory /var/www/html for the web server document root. You can introduce your local project code with bind-mounted volumes:

$ docker run -p 80:80 --rm \
  -v $(pwd):/var/www/html \
  aspendigital/codeigniter:latest

Save yourself some keyboards strokes, utilize docker-compose by introducing a docker-compose.yml file to your project folder:

# docker-compose.yml
version: '2.2'
services:
  web:
    image: aspendigital/codeigniter:latest
    ports:
      - 80:80
    volumes:
      - $PWD:/var/www/html

With the above example saved in working directory, run:

$ docker-compose up -d # start services defined in `docker-compose.yml` in the background
$ docker-compose down # stop and destroy

Environment Variables

Environment variables can be passed to docker-compose.

The following variables trigger actions run by the entrypoint script at runtime.

Variable Default Action
ENABLE_CRON false true starts a cron process within the container
FWD_REMOTE_IP false true enables remote IP forwarding from proxy (Apache)
PHP_DISPLAY_ERRORS off Override value for display_errors in docker-ci-php.ini
PHP_POST_MAX_SIZE 32M Override value for post_max_size in docker-ci-php.ini
PHP_MEMORY_LIMIT 128M Override value for memory_limit in docker-ci-php.ini
PHP_UPLOAD_MAX_FILESIZE 32M Override value for upload_max_filesize in docker-ci-php.ini
TZ UTC Override value for data.timezone in docker-ci-php.ini

docker-codeigniter's People

Contributors

petehalverson avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.