From c0be6d440f9ada1b70cbda14addce480b3127e29 Mon Sep 17 00:00:00 2001 From: sunjay <9930542+zunjae@users.noreply.github.com> Date: Fri, 19 Jul 2019 14:00:27 +0200 Subject: [PATCH] initial commit --- README.md | 21 +++++++++++++++++++-- docker-compose.yml | 17 +++++++++++++++++ jikan/.env | 42 ++++++++++++++++++++++++++++++++++++++++++ jikan/Dockerfile | 18 ++++++++++++++++++ jikan/run-jikan.sh | 6 ++++++ 5 files changed, 102 insertions(+), 2 deletions(-) create mode 100644 docker-compose.yml create mode 100755 jikan/.env create mode 100755 jikan/Dockerfile create mode 100755 jikan/run-jikan.sh diff --git a/README.md b/README.md index b9784b4..aff88af 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,19 @@ -# JikanDockerized -JikanDockerized +Based off https://github.com/tzw0745/jikan-rest-docker + +```bash +$ docker-compose build +$ docker-compose up -d +``` + +## Usage + +Access the API (v3) `port 9001`: + +``` +http://localhost:9001/public/v3 +``` + +## More info + +- [Jikan REST API](https://github.com/jikan-me/jikan-rest) +- [API docs](https://jikan.docs.apiary.io) diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..cb15ebb --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,17 @@ +version: "3" + +services: + + jikan-rest: + build: + context: jikan + dockerfile: Dockerfile + depends_on: + - jikan-redis + ports: + - "9001:80" + restart: always + + jikan-redis: + image: redis:5.0.3 + restart: always diff --git a/jikan/.env b/jikan/.env new file mode 100755 index 0000000..35426ef --- /dev/null +++ b/jikan/.env @@ -0,0 +1,42 @@ +APP_ENV=production +APP_DEBUG=false +APP_KEY= +APP_TIMEZONE=UTC +APP_URL=http://localhost + +DB_CONNECTION=mysql +DB_HOST=127.0.0.1 +DB_PORT=3306 +DB_DATABASE=homestead +DB_USERNAME=homestead +DB_PASSWORD=secret + +CACHE_DRIVER=file +QUEUE_DRIVER=redis + +CACHE_METHOD=legacy +CACHE_DEFAULT_EXPIRE=86400 +CACHE_META_EXPIRE=300 +CACHE_USER_EXPIRE=300 +CACHE_404_EXPIRE=604800 +CACHE_SEARCH_EXPIRE=432000 + +QUEUE_DELAY_PER_JOB=5 + +THROTTLE=false +THROTTLE_DECAY_MINUTES=1 +THROTTLE_MAX_PER_DECAY_MINUTES=30 +THROTTLE_MAX_PER_CONCURRENCY=2 + +SLAVE_INSTANCE=false +SLAVE_KEY= +SLAVE_CLIENT_IP_HEADER="X-Real-IP" +SLAVE_KEY_HEADER="X-Master" + +REDIS_HOST=jikan-redis +REDIS_PASSWORD=null +REDIS_PORT=6379 + +GITHUB_REPORTING=false +GITHUB_REST="jikan-me/jikan-rest" +GITHUB_API="jikan-me/jikan diff --git a/jikan/Dockerfile b/jikan/Dockerfile new file mode 100755 index 0000000..6c1be9d --- /dev/null +++ b/jikan/Dockerfile @@ -0,0 +1,18 @@ +FROM php:7.3.2-apache-stretch + +ENV COMPOSER_ALLOW_SUPERUSER 1 + +RUN apt-get update && apt-get install -y \ + openssl \ + git \ + unzip \ + && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \ + && composer --version \ + && a2enmod rewrite \ + && service apache2 restart \ + && git clone https://github.com/jikan-me/jikan-rest.git . \ + && composer install --prefer-dist --no-progress --no-suggest --classmap-authoritative --no-interaction + +ADD .env /run-jikan.sh ./ + +ENTRYPOINT ["./run-jikan.sh"] \ No newline at end of file diff --git a/jikan/run-jikan.sh b/jikan/run-jikan.sh new file mode 100755 index 0000000..fd1c4ea --- /dev/null +++ b/jikan/run-jikan.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +# allow write permission +chmod -R a+w storage/ + +# php:7.3.2-apache-stretch ENTRYPOINT +docker-php-entrypoint apache2-foreground \ No newline at end of file