Move to an alpine based image (#9)

Should make things smaller memory and storage wise

Co-authored-by: Angel Garcia <a-garcia-alvarez@users.noreply.github.com>
alpine
Angel Garcia 3 years ago committed by GitHub
parent db3954e7e3
commit 6e52181919
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,21 +1,23 @@
FROM php:7.4-apache
FROM php:7.4-cli-alpine
ENV COMPOSER_ALLOW_SUPERUSER 1
RUN apt-get update && apt-get install -y \
openssl \
RUN apk add --no-cache \
git \
unzip \
&& apt-get clean && rm -rf /var/lib/apt/lists/* \
rm -rf /var/cache/apk/* \
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
&& composer --version
WORKDIR /var/www/html
USER www-data:www-data
RUN git clone https://github.com/jikan-me/jikan-rest.git -b v3 . \
&& git checkout v3 \
&& cp .env.dist .env \
&& composer require 'composer/package-versions-deprecated' \
&& composer install --prefer-dist --no-progress --classmap-authoritative --no-interaction \
&& composer update jikan-me/jikan
&& composer update
RUN sed -i "s/CACHE_DRIVER=.*/CACHE_DRIVER=redis/" .env \
&& sed -i "s/REDIS_HOST=.*/REDIS_HOST=redis/" .env \

@ -1,3 +1,3 @@
#!/usr/bin/env bash
#!/usr/bin/env sh
chmod -R a+w storage/
php -S 0.0.0.0:8080 -t public
Loading…
Cancel
Save