Updates static and development files for .env and dockerfile changes
This commit is contained in:
parent
6a14acb6dc
commit
7f65f8a67c
2 changed files with 111 additions and 0 deletions
53
development/env_upgrade.sh
Executable file
53
development/env_upgrade.sh
Executable file
|
|
@ -0,0 +1,53 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# backup old .env
|
||||
cp ./.env ./.env.old
|
||||
|
||||
# delete unnecessary lines
|
||||
OS=$(uname)
|
||||
if [ "$OS" == "Linux" ]; then
|
||||
sed -i '/PROJECT_ROOT.*$/d' .env
|
||||
sed -i '/CONTAINER_NAME.*$/d' .env
|
||||
elif [ "$OS" == "Darwin" ]; then
|
||||
sed -i '' '/PROJECT_ROOT.*$/d' .env
|
||||
sed -i '' '/CONTAINER_NAME.*$/d' .env
|
||||
fi
|
||||
|
||||
|
||||
# insert new lines
|
||||
echo "LE_EMAIL=\"\"" >> .env
|
||||
echo "MYSQL_HOST=\"mariadb\"" >> .env
|
||||
echo "MYSQL_PORT=\"3306\"" >> .env
|
||||
echo "MYSQL_USER=\"root\"" >> .env
|
||||
echo "MYSQL_PF_DB_NAME=\"pathfinder\"" >> .env
|
||||
echo "MYSQL_UNIVERSE_DB_NAME=\"eve_universe\"" >> .env
|
||||
echo "MYSQL_CCP_DB_NAME=\"eve_lifeblood_min\"" >> .env
|
||||
echo "REDIS_HOST=\"redis\"" >> .env
|
||||
echo "REDIS_PORT=\"6379\"" >> .env
|
||||
echo "PATHFINDER_SOCKET_HOST=\"pathfinder-socket\"" >> .env
|
||||
echo "PATHFINDER_SOCKET_PORT=\"5555\"" >> .env
|
||||
echo "SMTP_HOST=\"\"" >> .env
|
||||
echo "SMTP_PORT=\"\"" >> .env
|
||||
echo "SMTP_SCHEME=\"\"" >> .env
|
||||
echo "SMTP_USER=\"\"" >> .env
|
||||
echo "SMTP_PASS=\"\"" >> .env
|
||||
echo "SMTP_FROM=\"\"" >> .env
|
||||
echo "SMTP_ERROR=\"\"" >> .env
|
||||
|
||||
# sort new file alphabetically into .new file
|
||||
cat .env | sort > ./.env.new
|
||||
|
||||
# print new file for inspection
|
||||
echo ""
|
||||
cat ./.env.new
|
||||
|
||||
# user input to check and save/abort
|
||||
while true; do
|
||||
echo ""
|
||||
read -p "Overwrite .env with the new file? Y/n: " yn
|
||||
case $yn in
|
||||
[Yy]* ) mv ./.env.new ./.env; echo "Created new .env, old version backed up to .env.old"; break;;
|
||||
[Nn]* ) mv ./.env.old ./.env; echo "Aborting overwrite, new file saved as .env.new" ; exit;;
|
||||
* ) echo "Y/n";;
|
||||
esac
|
||||
done
|
||||
58
development/pathfinder.Dockerfile.develop
Normal file
58
development/pathfinder.Dockerfile.develop
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
FROM php:7.2.11-fpm-alpine3.7 as build
|
||||
|
||||
RUN apk update \
|
||||
&& apk add --no-cache libpng-dev zeromq-dev git \
|
||||
$PHPIZE_DEPS \
|
||||
&& docker-php-ext-install gd && docker-php-ext-install pdo_mysql && \
|
||||
pecl install redis && docker-php-ext-enable redis && \
|
||||
pecl install channel://pecl.php.net/zmq-1.1.3 && docker-php-ext-enable zmq && \
|
||||
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
||||
|
||||
COPY pathfinder /app
|
||||
WORKDIR /app
|
||||
|
||||
RUN composer self-update 2.1.8
|
||||
RUN composer install
|
||||
|
||||
FROM trafex/alpine-nginx-php7:ba1dd422
|
||||
|
||||
RUN apk update && apk add --no-cache busybox-suid sudo php7-redis php7-pdo php7-pdo_mysql php7-fileinfo php7-event shadow gettext bash apache2-utils logrotate
|
||||
|
||||
# symlink nginx logs to stdout/stderr for supervisord
|
||||
RUN ln -sf /dev/stdout /var/log/nginx/access.log \
|
||||
&& ln -sf /dev/stderr /var/log/nginx/error.log
|
||||
|
||||
COPY static/logrotate/pathfinder /etc/logrotate.d/pathfinder
|
||||
COPY static/nginx/nginx.conf /etc/nginx/templateNginx.conf
|
||||
# we need to create sites_enabled directory in order for entrypoint.sh being able to copy file after envsubst
|
||||
RUN mkdir -p /etc/nginx/sites_enabled/
|
||||
COPY static/nginx/site.conf /etc/nginx/templateSite.conf
|
||||
|
||||
# Configure PHP-FPM
|
||||
COPY static/php/fpm-pool.conf /etc/php7/php-fpm.d/zzz_custom.conf
|
||||
|
||||
# DEBUG
|
||||
RUN apk add php7-xdebug --repository http://dl-3.alpinelinux.org/alpine/edge/testing/
|
||||
COPY static/php/xdebug.ini /etc/php7/conf.d/xdebug.ini
|
||||
COPY static/php/error_reporting.ini /etc/php7/conf.d/error_reporting.ini
|
||||
RUN echo "zend_extension=/usr/lib/php7/modules/xdebug.so" >> /etc/php7/php.ini
|
||||
|
||||
COPY static/php/php.ini /etc/zzz_custom.ini
|
||||
# configure cron
|
||||
COPY static/crontab.txt /var/crontab.txt
|
||||
# Configure supervisord
|
||||
COPY static/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||
COPY static/entrypoint.sh /
|
||||
|
||||
WORKDIR /var/www/html
|
||||
COPY --chown=nobody --from=build /app pathfinder
|
||||
|
||||
RUN chmod 0766 pathfinder/logs pathfinder/tmp/ && rm index.php && touch /etc/nginx/.setup_pass && chmod +x /entrypoint.sh
|
||||
COPY static/pathfinder/routes.ini /var/www/html/pathfinder/app/
|
||||
COPY static/pathfinder/environment.ini /var/www/html/pathfinder/app/templateEnvironment.ini
|
||||
|
||||
WORKDIR /var/www/html
|
||||
EXPOSE 80
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue