Home Page › Forums › Public Free Forum › Upload the source code of my CodeIgniter website on Coolify › Reply To: Upload the source code of my CodeIgniter website on Coolify
-
Or you can can build your Docker Image locally and push to the registry and deploy easily in coolify as we showed in the course with FastAPI Projects.
the DockerFile will something like:
FROM php:8.2-fpm-alpine as phpbase
WORKDIR /var/www
# Install extensions
RUN apk add --no-cache $PHPIZE_DEPS libpng-dev libjpeg-turbo-dev libzip-dev icu-dev oniguruma-dev \
&& docker-php-ext-configure gd --with-jpeg \
&& docker-php-ext-install pdo pdo_mysql gd zip intl mbstring
# Composer (if you use it)
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
# Copy app files
COPY . /var/www
# Install deps (if composer.json exists)
RUN if [ -f composer.json ]; then composer install --no-dev --prefer-dist --no-interaction; fi
# -------------------------
FROM nginx:alpine
WORKDIR /var/www
# Copy code
COPY . /var/www
# Nginx config (CI4 public/ root assumed)
COPY deploy/nginx/default.conf /etc/nginx/conf.d/default.conf
# PHP-FPM sidecar inside same container (using s6-overlay-like approach is ideal,
# but for simplicity we'll run php-fpm in background via dumb-init).
# Install php-fpm runtime:
RUN apk add --no-cache php82-fpm php82-mysqli php82-intl php82-gd php82-zip php82-mbstring php82-session \
&& sed -i 's|^;cgi.fix_pathinfo=.*|cgi.fix_pathinfo=0|' /etc/php82/php.ini
# Entrypoint: start php-fpm then nginx (simple supervisor-less approach)
CMD sh -lc "php-fpm82 -F & nginx -g 'daemon off;'"
