Skip to content

Commit

Permalink
Merge pull request #4 from owowagency/feature/php-8-3
Browse files Browse the repository at this point in the history
  • Loading branch information
Sjoertjuh authored Dec 22, 2023
2 parents f9e2935 + 1050050 commit 20206f2
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 20 deletions.
38 changes: 18 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:8.2-fpm
FROM php:8.3-fpm

RUN apt-get update && apt-get install -y \
libfreetype6-dev \
Expand All @@ -10,16 +10,31 @@ RUN apt-get update && apt-get install -y \
unzip \
ffmpeg

# Imagick for php8.3 is broken right now, see https://github.com/Imagick/imagick/pull/641

RUN pecl install \
redis \
imagick \
# imagick \
xdebug

RUN docker-php-ext-enable \
redis \
imagick \
# imagick \
xdebug

# So for now we need to build imagick from source

RUN apt-get install -y git

RUN git clone https://github.com/Imagick/imagick.git --depth 1 /tmp/imagick && \
cd /tmp/imagick && \
phpize && \
./configure && \
make && \
make install

RUN docker-php-ext-enable imagick

RUN docker-php-ext-configure \
gd --with-freetype --with-jpeg

Expand All @@ -43,20 +58,3 @@ RUN docker-php-ext-install \
pcntl

COPY --from=composer:latest /usr/bin/composer /usr/bin/composer

ENV PHP_MEMORY_LIMIT=512M

RUN cd /usr/local/etc/php/conf.d/ && \
echo 'memory_limit = 512M' >> /usr/local/etc/php/conf.d/docker-php-memory-limit.ini

ENV NODE_VERSION=16.17.0
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
ENV NVM_DIR=/root/.nvm
RUN . "$NVM_DIR/nvm.sh" && nvm install ${NODE_VERSION}
RUN . "$NVM_DIR/nvm.sh" && nvm use v${NODE_VERSION}
RUN . "$NVM_DIR/nvm.sh" && nvm alias default v${NODE_VERSION}
ENV PATH="/root/.nvm/versions/node/v${NODE_VERSION}/bin/:${PATH}"
RUN npm install -g yarn

RUN echo "xdebug.mode = debug" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN echo "xdebug.client_host = host.docker.internal" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Docker Laravel PHP

![Docker Image Version (latest semver)](https://img.shields.io/docker/v/owow/laravel-php?logo=docker)
![Docker Image Size (tag)](https://img.shields.io/docker/image-size/owow/laravel-php/latest?logo=docker)
![Docker Automated build](https://img.shields.io/docker/automated/owow/laravel-php?logo=docker)

A docker image that can be used to run Laravel applications.

## Automated builds

This repository is automatically built and pushed to Docker Hub using Docker Automated Builds.

You can set up your own automated builds by following the steps below.

1. Go to your repository in Docker Hub. If you don't have one yet, create one.
1. Open the `Builds` tab.
1. Add the repo from GitHub or Bitbucket.
1. Configure the build settings:
1. `Autotest` will test the build (not deploy it) whenever you trigger the selected action.
1. `Repository links` will trigger a build when one of the used base images (`FROM ...`) is updated.
1. `Build rules` will determine when to build the image:
1. You probably want to keep the `latest` tag when pushing to `main`/`master`.
1. You can add a tag by regex, for example `^[\d.]+` to match `1.0.0` and `1.0.1-dev` (Click on `View example build rules` for more examples).
1. Now when you push to master on GitHub, it will automatically build and push the selected image to Docker Hub under the `latest` tag.
When you create a tag, it will build and push the selected image to Docker Hub under the tag that matches the regex output (capture group or whole tag).
1. You can also trigger a build manually by clicking `Trigger` on the `Builds` page

0 comments on commit 20206f2

Please sign in to comment.