Welcome Guest, Not a member yet? Register   Sign In
Codeigniter 4 and Docker
#6

(This post was last modified: 12-29-2019, 12:40 PM by atsanna.)

If you wish, you can use this basic example to create your container (tested on Ubuntu 18.04 - Docker version 19.03.5, build 633a0ea838):

1) create this structure

codeigniter /
    - conf / apache.conf
    - Dockerfile

apache.conf
Code:
<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot "/var/www/html/codeigniter4/public"
    ServerName localhost
    <Directory "/var/www/html/codeigniter4/public/">
        AllowOverride all
    </Directory>
</VirtualHost>

Dockerfile

Code:
FROM php:7.2.26-apache

RUN apt-get update
RUN apt-get upgrade -y

RUN apt-get install --fix-missing -y libpq-dev
RUN apt-get install --no-install-recommends -y libpq-dev
RUN apt-get install -y libxml2-dev libbz2-dev zlib1g-dev
RUN apt-get -y install libsqlite3-dev libsqlite3-0 mariadb-client curl exif ftp
RUN docker-php-ext-install intl
RUN apt-get -y install --fix-missing zip unzip

# Composer
RUN curl -sS https://getcomposer.org/installer | php
RUN mv composer.phar /usr/local/bin/composer
RUN chmod +x /usr/local/bin/composer
RUN composer self-update

ADD conf/apache.conf /etc/apache2/sites-available/000-default.conf

RUN cd /var/www/html
RUN composer create-project codeigniter4/appstarter codeigniter4 -s rc
RUN ls
RUN chmod -R 0777 /var/www/html/codeigniter4/writable

RUN apt-get clean \
    && rm -r /var/lib/apt/lists/*
    
VOLUME /var/www/html

2) Go to the codeigniter folder
   cd codeigniter

3) build the image
Code:
docker build . -t codeginiter:4.0.0-rc.3


4) start the container
Code:
docker container run --publish 80:80 --name ci4 codeginiter:4.0.0-rc.3


At this point you should see the page on the browser ...
Codeigniter 4 - Docker Image [github] [docker hub]
Reply


Messages In This Thread
Codeigniter 4 and Docker - by andybiancoblu - 09-26-2019, 07:11 AM
RE: Codeigniter 4 and Docker - by ciadmin - 09-26-2019, 07:38 AM
RE: Codeigniter 4 and Docker - by taliffsss - 04-21-2020, 07:11 PM
RE: Codeigniter 4 and Docker - by engel - 11-18-2019, 03:44 AM
RE: Codeigniter 4 and Docker - by john_brahy.com - 12-22-2019, 02:06 PM
RE: Codeigniter 4 and Docker - by InsiteFX - 12-23-2019, 04:26 AM
RE: Codeigniter 4 and Docker - by atsanna - 12-29-2019, 12:37 PM
RE: Codeigniter 4 and Docker - by MGatner - 01-02-2020, 09:03 AM
RE: Codeigniter 4 and Docker - by atsanna - 01-02-2020, 09:16 AM
RE: Codeigniter 4 and Docker - by atsanna - 04-13-2020, 10:31 AM
RE: Codeigniter 4 and Docker - by kenjis - 12-07-2020, 11:06 PM
RE: Codeigniter 4 and Docker - by mal2tin - 04-14-2020, 04:49 AM
RE: Codeigniter 4 and Docker - by atsanna - 04-14-2020, 08:30 AM
RE: Codeigniter 4 and Docker - by atsanna - 04-30-2020, 11:17 PM
RE: Codeigniter 4 and Docker - by Avenirer - 10-12-2020, 07:07 AM
RE: Codeigniter 4 and Docker - by tttt - 03-21-2022, 03:57 AM



Theme © iAndrew 2016 - Forum software by © MyBB