Updates static and development files for .env and dockerfile changes

This commit is contained in:
Sam ONeill 2023-04-15 22:22:39 +12:00
parent 7f65f8a67c
commit 6c3c6bc5dd
9 changed files with 68 additions and 121 deletions

2
.gitignore vendored
View file

@ -1,4 +1,4 @@
.env .env*
.vscode .vscode
letsencrypt letsencrypt
*.production* *.production*

View file

@ -1,7 +1,7 @@
; Global Framework Config ; Global Framework Config
[SERVER] [SERVER]
SERVER_NAME = PATHFINDER COMMUNITY EDITION SERVER_NAME = ${SERVER_NAME}
[globals] [globals]
; Verbosity level of error stack trace for errors ; Verbosity level of error stack trace for errors

View file

@ -1,9 +1,25 @@
CONTAINER_NAME="pfdev"
DOMAIN="localhost"
SERVER_NAME="PFDEV"
APP_PASSWORD="DEVPASSWORD" 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"
MYSQL_HOST="mariadb"
MYSQL_PASSWORD="PASSWORD" MYSQL_PASSWORD="PASSWORD"
CCP_SSO_CLIENT_ID="" MYSQL_PF_DB_NAME="pathfinder"
CCP_SSO_SECRET_KEY="" MYSQL_PORT="3306"
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" MYSQL_UNIVERSE_DB_NAME="eve_universe"
MYSQL_USER="root"
PATHFINDER_SOCKET_HOST="pathfinder-socket"
PATHFINDER_SOCKET_PORT="5555"
REDIS_HOST="redis"
REDIS_PORT="6379"
SERVER_NAME="PFDEV"
SMTP_ERROR=""
SMTP_FROM=""
SMTP_HOST=""
SMTP_PASS=""
SMTP_PORT=""
SMTP_SCHEME=""
SMTP_USER=""
XDEBUG_CONFIG="remote_host=host.docker.internal remote_port=9000 remote_enable=1" XDEBUG_CONFIG="remote_host=host.docker.internal remote_port=9000 remote_enable=1"

View file

@ -1,56 +0,0 @@
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 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"]

View file

@ -2,13 +2,13 @@
# preserve original production files # preserve original production files
mv ./docker-compose.yml ./docker-compose.production.yml mv ./docker-compose.yml ./docker-compose.production.yml
mv ./Dockerfile ./Dockerfile.production mv ./pathfinder.Dockerfile ./pathfinder.Dockerfile.production
mv ./static/pathfinder/environment.ini ./static/pathfinder/environment.production.ini mv ./static/pathfinder/environment.ini ./static/pathfinder/environment.production.ini
mv ./static/php/php.ini ./static/php/php.production.ini mv ./static/php/php.ini ./static/php/php.production.ini
# copy development versions # copy development versions
cp ./development/docker-compose.development.yml ./docker-compose.yml cp ./development/docker-compose.development.yml ./docker-compose.yml
cp ./development/Dockerfile.development ./Dockerfile cp ./development/pathfinder.Dockerfile.developm ./pathfinder.Dockerfile
cp ./development/environment.development.ini ./static/pathfinder/environment.ini cp ./development/environment.development.ini ./static/pathfinder/environment.ini
cp ./development/php.development.ini ./static/php/php.ini cp ./development/php.development.ini ./static/php/php.ini
cp ./development/xdebug.ini ./static/php/xdebug.ini cp ./development/xdebug.ini ./static/php/xdebug.ini

View file

@ -5,18 +5,16 @@ services:
image: bianjp/mariadb-alpine:latest image: bianjp/mariadb-alpine:latest
environment: environment:
MYSQL_ROOT_PASSWORD: $MYSQL_PASSWORD MYSQL_ROOT_PASSWORD: $MYSQL_PASSWORD
container_name: "$CONTAINER_NAME-db"
networks: networks:
pf: pf:
aliases: aliases:
- "${CONTAINER_NAME}db" - "$MYSQL_HOST"
volumes: volumes:
- db_data:/var/lib/mysql - db_data:/var/lib/mysql
- $PROJECT_ROOT/pathfinder/export/sql/eve_universe.sql.zip:/eve_universe.sql.zip - $PROJECT_ROOT/pathfinder/export/sql/eve_universe.sql.zip:/eve_universe.sql.zip
restart: always restart: always
pf-redis: pf-redis:
image: redis:6.2.5-alpine3.14 image: redis:6.2.5-alpine3.14
container_name: "$CONTAINER_NAME-redis"
command: ["redis-server", "--appendonly", "yes"] command: ["redis-server", "--appendonly", "yes"]
hostname: redis hostname: redis
volumes: volumes:
@ -24,25 +22,20 @@ services:
networks: networks:
pf: pf:
aliases: aliases:
- "$CONTAINER_NAME-redis" - "$REDIS_HOST"
logging: logging:
driver: none driver: none
restart: always restart: always
pf-socket: pf-socket:
image: composer:composer@sha256:d374b2e1f715621e9d9929575d6b35b11cf4a6dc237d4a08f2e6d1611f534675 image: ghcr.io/goryn-clade/pf-websocket:latest
container_name: "$CONTAINER_NAME-socket" command: ["--tcpHost", "0.0.0.0"]
command: ["sh","-c","composer install && php cmd.php --tcpHost 0.0.0.0"]
hostname: socket hostname: socket
volumes:
- ${PROJECT_ROOT}/websocket:/app
- ${PROJECT_ROOT}/logs:/var/www/html/pathfinder/history/map
networks: networks:
pf: pf:
aliases: aliases:
- "$CONTAINER_NAME-socket" - "$PATHFINDER_SOCKET_HOST"
restart: always restart: always
pf: pf:
container_name: ${CONTAINER_NAME}
hostname: "pathfinder" hostname: "pathfinder"
build: '.' build: '.'
env_file: env_file:
@ -64,10 +57,10 @@ services:
healthcheck: healthcheck:
disable: true disable: true
volumes: volumes:
- ${PROJECT_ROOT}/config/pathfinder/config.ini:/var/www/html/pathfinder/app/templateConfig.ini - ./config/pathfinder/config.ini:/var/www/html/pathfinder/app/templateConfig.ini
- ${PROJECT_ROOT}/config/pathfinder/pathfinder.ini:/var/www/html/pathfinder/app/pathfinder.ini - ./config/pathfinder/pathfinder.ini:/var/www/html/pathfinder/app/pathfinder.ini
- ${PROJECT_ROOT}/config/pathfinder/plugin.ini:/var/www/html/pathfinder/app/plugin.ini - ./config/pathfinder/plugin.ini:/var/www/html/pathfinder/app/plugin.ini
- ${PROJECT_ROOT}/logs:/var/www/html/pathfinder/history/map - ./logs:/var/www/html/pathfinder/history/map
depends_on: depends_on:
- pfdb - pfdb
- pf-redis - pf-redis
@ -100,4 +93,3 @@ volumes:
networks: networks:
pf: pf:
web: web:
external: true

View file

@ -4,34 +4,34 @@
; project environment (DEVELOP || PRODUCTION). ; project environment (DEVELOP || PRODUCTION).
; This effects: DB connection, Mail-Server, SSO, ESI configurations in this file ; This effects: DB connection, Mail-Server, SSO, ESI configurations in this file
; configuration below ; configuration below
SERVER = DEVELOPMENT SERVER = DEVELOP
[ENVIRONMENT.DEVELOPMENT] [ENVIRONMENT.PRODUCTION]
; path to index.php (Default: leave blank == "auto-detect") ; path to index.php (Default: leave blank == "auto-detect")
; -> e.g. set /pathfinder if your URL looks like https://www.[YOUR_DOMAIN]/pathfinder (subfolder) ; -> e.g. set /pathfinder if your URL looks like https://www.[YOUR_DOMAIN]/pathfinder (subfolder)
BASE = BASE =
; deployment URL (e.g. https://www.pathfinder-w.space) ; deployment URL (e.g. https://www.pathfinder-w.space)
URL = {{@SCHEME}}://$DOMAIN URL = {{@SCHEME}}://$DOMAIN
; level of debug/error stack trace ; level of debug/error stack trace
DEBUG = 3 DEBUG = 0
; Pathfinder database ; Pathfinder database
DB_PF_DNS = mysql:host=${CONTAINER_NAME}db;port=3306;dbname= DB_PF_DNS = mysql:host=${MYSQL_HOST};port=${MYSQL_PORT};dbname=
DB_PF_NAME = pf DB_PF_NAME = $MYSQL_PF_DB_NAME
DB_PF_USER = root DB_PF_USER = $MYSQL_USER
DB_PF_PASS = $MYSQL_PASSWORD DB_PF_PASS = $MYSQL_PASSWORD
; Universe data (New Eden) cache DB for ESI API respons ; Universe data (New Eden) cache DB for ESI API response
DB_UNIVERSE_DNS = mysql:host=${CONTAINER_NAME}db;port=3306;dbname= DB_UNIVERSE_DNS = mysql:host=${MYSQL_HOST};port=${MYSQL_PORT};dbname=
DB_UNIVERSE_NAME = eve_universe DB_UNIVERSE_NAME = $MYSQL_UNIVERSE_DB_NAME
DB_UNIVERSE_USER = root DB_UNIVERSE_USER = $MYSQL_USER
DB_UNIVERSE_PASS = $MYSQL_PASSWORD DB_UNIVERSE_PASS = $MYSQL_PASSWORD
; EVE-Online CCP Database export ; EVE-Online CCP Database export
DB_CCP_DNS = mysql:host=${CONTAINER_NAME}db;port=3306;dbname= DB_CCP_DNS = mysql:host=${MYSQL_HOST};port=${MYSQL_PORT};dbname=
DB_CCP_NAME = eve_lifeblood_min DB_CCP_NAME = $MYSQL_CCP_DB_NAME
DB_CCP_USER = root DB_CCP_USER = $MYSQL_USER
DB_CCP_PASS = $MYSQL_PASSWORD DB_CCP_PASS = $MYSQL_PASSWORD
; CCP SSO ; CCP SSO
CCP_SSO_URL = https://login.eveonline.com CCP_SSO_URL = https://login.eveonline.com
@ -47,15 +47,15 @@ CCP_ESI_SCOPES = $CCP_ESI_SCOPES
CCP_ESI_SCOPES_ADMIN = CCP_ESI_SCOPES_ADMIN =
; SMTP settings (optional) ; SMTP settings (optional)
SMTP_HOST = localhost SMTP_HOST = $SMTP_HOST
SMTP_PORT = 25 SMTP_PORT = $SMTP_PORT
SMTP_SCHEME = TLS SMTP_SCHEME = $SMTP_SCHEME
SMTP_USER = SMTP_USER = $SMTP_USER
SMTP_PASS = SMTP_PASS = $SMTP_PASS
SMTP_FROM = registration@pathfinder-w.space SMTP_FROM = $SMTP_FROM
SMTP_ERROR = admin@pathfinder-w.space SMTP_ERROR = $SMTP_EMAIL
; TCP Socket configuration (optional) (advanced) ; TCP Socket configuration (optional) (advanced)
SOCKET_HOST = ${CONTAINER_NAME}-socket SOCKET_HOST = $PATHFINDER_SOCKET_HOST
SOCKET_PORT = 5555 SOCKET_PORT = $PATHFINDER_SOCKET_PORT

View file

@ -11,7 +11,7 @@ services:
- "$MYSQL_HOST" - "$MYSQL_HOST"
volumes: volumes:
- db_data:/var/lib/mysql - db_data:/var/lib/mysql
- $PROJECT_ROOT/pathfinder/export/sql/eve_universe.sql.zip:/eve_universe.sql.zip - ./pathfinder/export/sql/eve_universe.sql.zip:/eve_universe.sql.zip
restart: always restart: always
pf-redis: pf-redis:
image: redis:6.2.5-alpine3.14 image: redis:6.2.5-alpine3.14
@ -27,9 +27,7 @@ services:
driver: none driver: none
restart: always restart: always
pf-socket: pf-socket:
build: image: ghcr.io/goryn-clade/pf-websocket:latest
context: '.'
dockerfile: '$PROJECT_ROOT/pf-websocket.Dockerfile'
command: ["--tcpHost", "0.0.0.0"] command: ["--tcpHost", "0.0.0.0"]
hostname: socket hostname: socket
networks: networks:
@ -39,9 +37,7 @@ services:
restart: always restart: always
pf: pf:
hostname: "pathfinder" hostname: "pathfinder"
build: image: ghcr.io/goryn-clade/pathfinder:latest
context: '.'
dockerfile: '$PROJECT_ROOT//pathfinder.Dockerfile'
env_file: env_file:
- .env - .env
labels: labels:
@ -62,10 +58,10 @@ services:
healthcheck: healthcheck:
disable: true disable: true
volumes: volumes:
- ${PROJECT_ROOT}/config/pathfinder/config.ini:/var/www/html/pathfinder/app/templateConfig.ini - ./config/pathfinder/config.ini:/var/www/html/pathfinder/app/templateConfig.ini
- ${PROJECT_ROOT}/config/pathfinder/pathfinder.ini:/var/www/html/pathfinder/app/pathfinder.ini - ./config/pathfinder/pathfinder.ini:/var/www/html/pathfinder/app/pathfinder.ini
- ${PROJECT_ROOT}/config/pathfinder/plugin.ini:/var/www/html/pathfinder/app/plugin.ini - ./config/pathfinder/plugin.ini:/var/www/html/pathfinder/app/plugin.ini
- ${PROJECT_ROOT}/logs:/var/www/html/pathfinder/history/map - ./logs:/var/www/html/pathfinder/history/map
depends_on: depends_on:
- pfdb - pfdb
- pf-redis - pf-redis
@ -93,7 +89,7 @@ services:
- "8080:8080" - "8080:8080"
volumes: volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro" - "/var/run/docker.sock:/var/run/docker.sock:ro"
- "${PROJECT_ROOT}/letsencrypt:/letsencrypt" - "./letsencrypt:/letsencrypt"
networks: networks:
- web - web
restart: always restart: always
@ -105,4 +101,3 @@ volumes:
networks: networks:
pf: pf:
web: web:
external: true

View file

@ -28,7 +28,7 @@ DB_UNIVERSE_PASS = $MYSQL_PASSWORD
; EVE-Online CCP Database export ; EVE-Online CCP Database export
DB_CCP_DNS = mysql:host=${MYSQL_HOST};port=${MYSQL_PORT};dbname= DB_CCP_DNS = mysql:host=${MYSQL_HOST};port=${MYSQL_PORT};dbname=
DB_CCP_NAME = $MYSQL_CCP_DB_NAME DB_CCP_NAME = $MYSQL_CCP_DB_NAME
DB_CCP_USER = $MYSQL_USER DB_CCP_USER = $MYSQL_USER
DB_CCP_PASS = $MYSQL_PASSWORD DB_CCP_PASS = $MYSQL_PASSWORD