Skip to content

Commit

Permalink
- Added docker files for development
Browse files Browse the repository at this point in the history
- Separeted dev and production namespace loader
  • Loading branch information
DavidBelicza committed Dec 29, 2023
1 parent c5ccfc9 commit 3b44ff8
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
COMPOSE_PROJECT_NAME=PHP-Science-TextRank

PREFIX=php-science-textrank

SOURCE_DIR=./
TARGET_DIR=/var/www/html
13 changes: 9 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "php-science/textrank",
"description": "TextRank (automatic text summarization) for PHP7 and HHVM.",
"keywords": ["science", "textrank", "automatic", "summarization", "PHP7", "PHP8", "strict"],
"description": "TextRank (automatic text summarization) for PHP.",
"keywords": ["science", "textrank", "automatic", "summarization", "PHP", "PHP8", "strict", "ai", "artificial", "intelligence"],
"license": "MIT",
"authors": [
{
"name": "David Belicza",
"email": "87.bdavid@gmail.com"
"email": "david@belicza.com"
}
],
"require": {
Expand All @@ -19,7 +19,12 @@
},
"autoload": {
"psr-4": {
"PhpScience\\TextRank\\": ["src/", "tests/"]
"PhpScience\\TextRank\\": ["src/"]
}
},
"autoload-dev": {
"psr-4": {
"PhpScience\\TextRank\\": ["tests/"]
}
},
"scripts": {
Expand Down
11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: '3'

services:

cli:
container_name: ${PREFIX}_cli
image: ${PREFIX}_cli
build: ./docker/cli
volumes:
- ${SOURCE_DIR}:${TARGET_DIR}
stdin_open: true
29 changes: 29 additions & 0 deletions docker/cli/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM php:8.2-cli

ENV TZ=Europe/Budapest
ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update

RUN apt-get install -y \
libfreetype6-dev \
libicu-dev \
libjpeg62-turbo-dev \
libmcrypt-dev \
libxslt1-dev

RUN apt-get install --no-install-recommends -y \
tzdata \
zip \
unzip \
git

RUN apt-get install -y software-properties-common

RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
RUN php -r "if (hash_file('sha384', 'composer-setup.php') === 'e21205b207c3ff031906575712edab6f13eb0b361f2085f1f1237b7126d785e826a450292b6cfd1d64d92e6563bbde02') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
RUN php composer-setup.php
RUN php -r "unlink('composer-setup.php');"
RUN mv composer.phar /usr/local/bin/composer

WORKDIR /var/www/html

0 comments on commit 3b44ff8

Please sign in to comment.