Official Docker Image of Synaps.is
FROM syis/php-nginx:7.4-alpine
# Install necessary packages
RUN apk --update add \
libzip-dev gmp-dev libsodium-dev openssl-dev \
npm mongo-c-driver
# Install the required PHP extensions
RUN docker-php-ext-configure zip \
&& docker-php-ext-install -j$(grep -c ^processor /proc/cpuinfo 2> /dev/null || 1) \
zip gmp \
&& docker-php-ext-install sodium \
&& pecl install mongodb \
&& docker-php-ext-enable mongodb \
&& docker-php-source delete \
&& rm -rf /tmp/* /var/cache/apk/* \
&& pecl config-set php_ini /etc/php.ini
RUN mkdir -p /var/www/app
WORKDIR /var/www/app
# Install composer packages
COPY composer.json ./
COPY composer.lock ./
# Install npm packages
COPY package.json ./
COPY package-lock.json ./
RUN composer install --no-scripts --no-autoloader --no-interaction --no-progress
RUN npm install
# Copy application files
COPY . ./
RUN composer dump-autoload --optimize
RUN npm run prod
# Copy nginx default virtual host
COPY docker/nginx/default.conf /etc/nginx/conf.d/
# Expose ports listened by your "default.conf"
EXPOSE 80
docker build . -t syis/php-nginx:8.1-alpine
docker push syis/php-nginx:8.1-alpine