TelegramApiServer/Dockerfile

28 lines
824 B
Docker
Raw Normal View History

2020-03-09 00:42:17 +01:00
FROM php:7.4-cli
COPY . /app
WORKDIR /app
2020-03-09 22:15:13 +01:00
#Remove .git and other dirs and files
2020-03-09 22:38:56 +01:00
RUN rm -rf .git/ .idea/ .DS_Store sessions/ .env
2020-03-09 22:15:13 +01:00
RUN pecl install apcu ev \
&& docker-php-ext-enable apcu ev \
&& echo 'memory_limit = 512M' >> /usr/local/etc/php/conf.d/php.ini \
2020-03-09 00:42:17 +01:00
&& apt-get update && apt-get install git zip vim nano -y \
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
&& composer global require hirak/prestissimo
RUN \
[ ! -d "vendor" ] && composer install -o --no-dev; \
\
[ -f ".env" ] && cat .env || cat .env.example \
| sed -e 's/SERVER_ADDRESS=127.0.0.1/SERVER_ADDRESS=0.0.0.0/g' \
| sed -e 's/IP_WHITELIST=127.0.0.1/IP_WHITELIST=/g' \
> .env;
2020-03-09 22:38:56 +01:00
VOLUME ["/app/sessions"]
2020-03-09 00:42:17 +01:00
EXPOSE 9503
ENTRYPOINT php server.php -s=*