Move to an alpine based image

Should make things smaller memory and storage wise
pull/9/head
Angel Garcia 3 years ago
parent db3954e7e3
commit c27adaa473

@ -1,21 +1,23 @@
FROM php:7.4-apache FROM php:7.4-cli-alpine
ENV COMPOSER_ALLOW_SUPERUSER 1 ENV COMPOSER_ALLOW_SUPERUSER 1
RUN apt-get update && apt-get install -y \ RUN apk add --no-cache \
openssl \
git \ git \
unzip \ 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 \ && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
&& composer --version && composer --version
WORKDIR /var/www/html
USER www-data:www-data
RUN git clone https://github.com/jikan-me/jikan-rest.git -b v3 . \ RUN git clone https://github.com/jikan-me/jikan-rest.git -b v3 . \
&& git checkout v3 \ && git checkout v3 \
&& cp .env.dist .env \ && cp .env.dist .env \
&& composer require 'composer/package-versions-deprecated' \ && composer require 'composer/package-versions-deprecated' \
&& composer install --prefer-dist --no-progress --classmap-authoritative --no-interaction \ && 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 \ RUN sed -i "s/CACHE_DRIVER=.*/CACHE_DRIVER=redis/" .env \
&& sed -i "s/REDIS_HOST=.*/REDIS_HOST=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/ chmod -R a+w storage/
php -S 0.0.0.0:8080 -t public php -S 0.0.0.0:8080 -t public
Loading…
Cancel
Save