diff --git a/development/.env.development b/development/.env.development index 78804ee..74e79ca 100644 --- a/development/.env.development +++ b/development/.env.development @@ -1,25 +1,26 @@ -APP_PASSWORD="DEVPASSWORD" -CCP_ESI_SCOPES="esi-location.read_online.v1,esi-location.read_location.v1,esi-location.read_ship_type.v1,esi-ui.write_waypoint.v1,esi-ui.open_window.v1,esi-universe.read_structures.v1,esi-corporations.read_corporation_membership.v1,esi-clones.read_clones.v1,esi-characters.read_corporation_roles.v1,esi-search.search_structures.v1"LE_EMAIL="" -CCP_SSO_CLIENT_ID="bebbf51a1bbc4189b07f4fd7ba10a9b9" -CCP_SSO_SECRET_KEY="NZDMwbVMHOD3dZdhPIFtQq8wHVZDouEK60I6IXau" -DOMAIN="localhost" -MYSQL_CCP_DB_NAME="eve_lifeblood_min" +DOMAIN="" +# Emails from Let's Encrypt about your certificate will go here +LE_EMAIL="" +APP_PASSWORD="" MYSQL_HOST="mariadb" -MYSQL_PASSWORD="PASSWORD" -MYSQL_PF_DB_NAME="pathfinder" MYSQL_PORT="3306" -MYSQL_UNIVERSE_DB_NAME="eve_universe" MYSQL_USER="root" -PATHFINDER_SOCKET_HOST="pathfinder-socket" -PATHFINDER_SOCKET_PORT="5555" +MYSQL_PASSWORD="" +MYSQL_PF_DB_NAME="pathfinder" +MYSQL_UNIVERSE_DB_NAME="eve_universe" +MYSQL_CCP_DB_NAME="eve_lifeblood_min" REDIS_HOST="redis" REDIS_PORT="6379" -SERVER_NAME="PFDEV" -SMTP_ERROR="" -SMTP_FROM="" +CCP_SSO_CLIENT_ID="" +CCP_SSO_SECRET_KEY="" +CCP_ESI_SCOPES="esi-location.read_online.v1,esi-location.read_location.v1,esi-location.read_ship_type.v1,esi-ui.write_waypoint.v1,esi-ui.open_window.v1,esi-universe.read_structures.v1,esi-corporations.read_corporation_membership.v1,esi-clones.read_clones.v1,esi-characters.read_corporation_roles.v1,esi-search.search_structures.v1" +PATHFINDER_SOCKET_HOST="pathfinder-socket" +PATHFINDER_SOCKET_PORT="5555" SMTP_HOST="" -SMTP_PASS="" SMTP_PORT="" SMTP_SCHEME="" SMTP_USER="" +SMTP_PASS="" +SMTP_FROM="" +SMTP_ERROR="" XDEBUG_CONFIG="remote_host=host.docker.internal remote_port=9000 remote_enable=1" diff --git a/docker-compose.yml b/docker-compose.yml index 61bf662..51b360e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -37,16 +37,17 @@ services: networks: pf: aliases: - - "$PATHFINDER_SOCKET_HOST" + - "$PATHFINDER_SOCKET_HOST" volumes: - ./logs:/var/www/html/pathfinder/history/map - /etc/timezone:/etc/timezone:ro - /etc/localtime:/etc/localtime:ro - restart: always pf: container_name: pathfinder - image: ghcr.io/goryn-clade/pathfinder:latest + build: + context: '.' + dockerfile: pathfinder.Dockerfile env_file: - .env labels: @@ -58,7 +59,6 @@ services: - "traefik.http.routers.pf-secure.rule=Host(`${DOMAIN}`)" - "traefik.http.routers.pf-secure.entrypoints=websecure" - "traefik.http.routers.pf-secure.tls=true" - - "traefik.http.routers.pf-secure.tls.certresolver=letsencrypt" - "traefik.http.middlewares.redirecthttps.redirectscheme.scheme=https" - "traefik.http.routers.pf.middlewares=redirecthttps" networks: @@ -88,19 +88,12 @@ services: - "--providers.docker.exposedbydefault=false" - "--entrypoints.web.address=:80" - "--entrypoints.websecure.address=:443" - - "--certificatesresolvers.letsencrypt.acme.httpchallenge=true" - - "--certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=web" - - "--certificatesresolvers.letsencrypt.acme.storage=/letsencrypt/acme.json" - # Remove below line when ready for production - - "--certificatesresolvers.letsencrypt.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory" # Remove this line only - - "--certificatesresolvers.letsencrypt.acme.email=${LE_EMAIL}" ports: - "80:80" - "443:443" - "8080:8080" volumes: - - /var/run/docker.sock:/var/run/docker.sock:ro - - ./letsencrypt:/letsencrypt + - "/var/run/docker.sock:/var/run/docker.sock:ro" - /etc/timezone:/etc/timezone:ro - /etc/localtime:/etc/localtime:ro networks: @@ -113,4 +106,4 @@ volumes: networks: pf: web: - external: true + external: true \ No newline at end of file diff --git a/pathfinder.Dockerfile b/pathfinder.Dockerfile index 9e9fc68..c3c3fe9 100644 --- a/pathfinder.Dockerfile +++ b/pathfinder.Dockerfile @@ -2,7 +2,7 @@ FROM php:7.2.34-fpm-alpine3.12 as build RUN apk update \ && apk add --no-cache libpng-dev zeromq-dev git \ - $PHPIZE_DEPS \ + $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 && \ @@ -16,12 +16,7 @@ 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 ca-certificates - -# fix expired DST Cert -RUN sed -i '/^mozilla\/DST_Root_CA_X3.crt$/ s/^/!/' /etc/ca-certificates.conf \ - && update-ca-certificates +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 \ @@ -36,6 +31,12 @@ 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 @@ -46,7 +47,7 @@ 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 +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 diff --git a/static/pathfinder/environment.ini b/static/pathfinder/environment.ini index 19c2a1f..da5de14 100644 --- a/static/pathfinder/environment.ini +++ b/static/pathfinder/environment.ini @@ -13,7 +13,7 @@ BASE = ; deployment URL (e.g. https://www.pathfinder-w.space) URL = {{@SCHEME}}://$DOMAIN ; level of debug/error stack trace -DEBUG = 0 +DEBUG = 3 ; Pathfinder database DB_PF_DNS = mysql:host=${MYSQL_HOST};port=${MYSQL_PORT};dbname= DB_PF_NAME = $MYSQL_PF_DB_NAME diff --git a/static/php/php.ini b/static/php/php.ini index e17d3c2..5425713 100755 --- a/static/php/php.ini +++ b/static/php/php.ini @@ -10,6 +10,7 @@ fastcgi.logging=0 request_terminate_timeout = 300 session.save_handler = redis session.save_path = "tcp://${REDIS_HOST}:${REDIS_PORT}" +zend_extension=/usr/lib/php7/modules/xdebug.so [Date] date.timezone="UTC"