I agree with NogDog about Docker - it's much faster and lighter than VirtualBox. The setup is different and (in my experience) more difficult at first. especially if you're not overly familiar with yaml. However, I'll say it was totally worth the learning curve. I've got a Dockerfile and docker-compose.yml that I used to test CI4 when it first came out. I was using MySQL and not MSSQL, so that part's completely untested, but hopefully this can at least get your started.
Note that the CI install was in a directory called project
at the same level as the Dockerfile and docker_compose.yml files below.
project_directory/Dockerfile
:
FROM php:7.4-apache
RUN apt-get update && apt-get install -y \
software-properties-common \
vim \
git \
zip \
curl \
sudo \
unzip \
libicu-dev \
libbz2-dev \
libpng-dev \
libjpeg-dev \
libmcrypt-dev \
libreadline-dev \
libfreetype6-dev \
libonig-dev \
libzip-dev
RUN a2enmod rewrite headers
RUN docker-php-ext-install \
bz2 \
intl \
iconv \
bcmath \
opcache \
calendar \
mbstring \
pdo_mysql \
mysqli \
zip \
pcntl
RUN docker-php-ext-enable \
bz2 \
intl \
iconv \
bcmath \
opcache \
calendar \
mbstring \
pdo_mysql \
mysqli \
zip \
pcntl
RUN docker-php-ext-configure gd
RUN docker-php-source delete
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
RUN cd /var/www/html
project_directory/docker-compose.yml
:
version: '3.5'
services:
ci_4:
build:
context: '.'
volumes:
- ./project:/var/www/html
ports:
- 80:80
networks:
- codeigniter
environment:
- ENVIRONMENT=development
database:
image: mcr.microsoft.com/mssql/server:2017-CU8-ubuntu
ports:
- 1433:1433
environment:
- ACCEPT_EULA=Y
- SA_PASSWORD=password
networks:
- codeigniter
volumes:
- ./_assets/sqldump:/docker-entrypoint-initdb.d
volumes:
db:
networks:
codeigniter: