Skip to content

Commit

Permalink
Upgrade to PHP 8.0.15
Browse files Browse the repository at this point in the history
  • Loading branch information
nicekiwi committed Feb 12, 2022
1 parent 57cd6bc commit 7f25011
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 48 deletions.
25 changes: 1 addition & 24 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
FROM php:8.0.9-fpm-alpine3.14
FROM php:8.0.15-alpine3.15

# Setup ARG defaults
ARG ENVIROMENT=production
ARG WORKDIR=/srv/app
ARG USER=root
ARG UID=1000
ARG TZ=UTC

ENV ENVIROMENT=${ENVIROMENT}
ENV WORKDIR=${WORKDIR}
ENV USER=${USER}
ENV UID=${UID}
ENV TZ=${TZ}

# Setup Timezone
Expand All @@ -26,26 +20,9 @@ RUN docker-php-ext-install pdo_pgsql exif pcntl bcmath gd
RUN pecl install redis-5.3.2 \
&& docker-php-ext-enable redis

# Install XDebug
RUN if [[ "${ENVIROMENT}" != "production" ]] ; then \
pecl install xdebug-3.0.2 \
&& docker-php-ext-enable xdebug ; \
fi

# Get latest Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer

# Set default php.ini
RUN mv "${PHP_INI_DIR}/php.ini-${ENVIROMENT}" "${PHP_INI_DIR}/php.ini"

# Setup uID for user
RUN if [[ "${ENVIROMENT}" != "production" ] && [ "${USER}" != "root" ]] ; then \
usermod -u ${UID} ${USER} ; \
fi

# Setup User
USER ${USER}

# Set Working Dir
WORKDIR ${WORKDIR}

26 changes: 2 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

Optimised for Laravel 8.

- Alpine 3.14
- PHP 8.0.9
- Alpine 3.15
- PHP 8.0.15
- Composer 2
- XDebug 3

Expand All @@ -15,30 +15,8 @@ Supports Redis and PostgreSQL.

```
# Defaults
ENVIRONMENT=production
WORKDIR=/srv/app
USER=root
TZ=UTC
# Set if ENVIROMENT != production && USER != root
UID=1000
```

`ENVIRONMENT` defines weather `development` or `production` php.ini template is used.

## XDebug

XDebug is only installed when build with `ENVIROMENT="development"` and is disabled by default.

Enable with:

```
# php.ini
[xdebug]
xdebug.mode=debug
xdebug.client_host=host.docker.internal
xdebug.client_port="9003"
```

https://github.com/nicekiwi/docker-php

0 comments on commit 7f25011

Please sign in to comment.