Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 39 additions & 32 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,41 +7,48 @@ LABEL core=php
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/

# Install php extensions
RUN chmod +x /usr/local/bin/install-php-extensions && sync && \
install-php-extensions mbstring pdo_mysql zip exif pcntl gd memcached bcmath
RUN chmod +x /usr/local/bin/install-php-extensions && \
sync && \
install-php-extensions mbstring \
pdo_mysql \
zip \
exif \
pcntl \
gd \
memcached \
bcmath

# Install dependencies
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libz-dev \
libpq-dev \
libjpeg-dev \
libpng-dev \
libssl-dev \
libzip-dev \
unzip \
zip \
nodejs \
&& apt-get clean \
&& pecl install redis \
&& docker-php-ext-configure gd \
&& docker-php-ext-configure zip \
&& docker-php-ext-install \
gd \
exif \
opcache \
pdo_mysql \
pdo_pgsql \
pgsql \
pcntl \
zip \
sockets \
bcmath \
&& docker-php-ext-enable redis \
&& rm -rf /var/lib/apt/lists/*;
RUN apt-get update && \
apt-get install -y --no-install-recommends libz-dev \
libpq-dev \
libjpeg-dev \
libpng-dev \
libssl-dev \
libzip-dev \
unzip \
zip \
nodejs && \
apt-get clean && \
pecl install redis && \
docker-php-ext-configure gd && \
docker-php-ext-configure zip && \
docker-php-ext-install gd \
exif \
opcache \
pdo_mysql \
pdo_pgsql \
pgsql \
pcntl \
zip \
sockets \
bcmath && \
docker-php-ext-enable redis && \
rm -rf /var/lib/apt/lists/*;

# swich uid and gid to 1000 to not overlap user with host system
RUN usermod -u 1000 www-data && groupmod -g 1000 www-data
RUN usermod -u 1000 www-data && \
groupmod -g 1000 www-data

# COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
Expand All @@ -56,7 +63,7 @@ RUN chmod 0755 /docker/startup.sh
WORKDIR /var/www
RUN chmod -R 0777 /var/www/storage

COPY . /var/www/
COPY --chown=www-data:www-data . /var/www/
RUN composer install --no-scripts --optimize-autoloader

#CMD ["/docker/startup.sh"]
8 changes: 8 additions & 0 deletions Dockerfile-nginx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM nginx:alpine

RUN apk add nano \
bash && \
rm /etc/nginx/conf.d/default.conf

COPY ./public /var/www/public
COPY ./docker/conf.d /etc/nginx/conf.d