From c27adaa47361eaf18f5d8f994f10ab17bdef4b15 Mon Sep 17 00:00:00 2001 From: Angel Garcia Date: Sat, 15 Oct 2022 13:48:02 +0200 Subject: [PATCH] Move to an alpine based image Should make things smaller memory and storage wise --- jikan/Dockerfile | 12 +++++++----- jikan/run-jikan.sh | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/jikan/Dockerfile b/jikan/Dockerfile index d32fec4..f83512d 100755 --- a/jikan/Dockerfile +++ b/jikan/Dockerfile @@ -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 \ diff --git a/jikan/run-jikan.sh b/jikan/run-jikan.sh index ad914d4..dab77dc 100755 --- a/jikan/run-jikan.sh +++ b/jikan/run-jikan.sh @@ -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 \ No newline at end of file