merges changes

This commit is contained in:
Sam ONeill 2023-04-14 19:42:44 +12:00
commit 43cd481310
11 changed files with 136 additions and 50 deletions

View file

@ -1,10 +1,26 @@
PROJECT_ROOT="" PROJECT_ROOT=""
CONTAINER_NAME="pf"
DOMAIN="" DOMAIN=""
# Emails from Let's Encrypt about your certificate will go here # Emails from Let's Encrypt about your certificate will go here
LE_EMAIL="" LE_EMAIL=""
APP_PASSWORD="" APP_PASSWORD=""
MYSQL_HOST="mariadb"
MYSQL_PORT="3306"
MYSQL_USER="root"
MYSQL_PASSWORD="" 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"
CCP_SSO_CLIENT_ID="" CCP_SSO_CLIENT_ID=""
CCP_SSO_SECRET_KEY="" 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" 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"
PATHFINDER_SOCKET_HOST="pathfinder-socket"
PATHFINDER_SOCKET_PORT="5555"
SMTP_HOST=""
SMTP_PORT=""
SMTP_SCHEME=""
SMTP_USER=""
SMTP_PASS=""
SMTP_FROM=""
SMTP_ERROR=""

48
.github/workflows/publish-docker.yaml vendored Normal file
View file

@ -0,0 +1,48 @@
name: Create and publish a Docker image
on:
release:
types: [published]
env:
REGISTRY: ghcr.io
IMAGE_NAME_OWNER: ${{ github.repository_owner }}
jobs:
build-and-publish:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- dockerfile: ./pathfinder.Dockerfile
image_name: pathfinder
- dockerfile: ./pf-websocket.Dockerfile
image_name: pf-websocket
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_OWNER }}/${{ matrix.image_name }}
- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
file: ${{ matrix.dockerfile }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

View file

@ -51,11 +51,27 @@ A fork of techfreak's [Pathfinder-container](https://gitlab.com/techfreak/pathfi
CONTAINER_NAME="pf" # docker container name prefix CONTAINER_NAME="pf" # docker container name prefix
DOMAIN="" # The domain you will be using DOMAIN="" # The domain you will be using
APP_PASSWORD="" # Password for /setup APP_PASSWORD="" # Password for /setup
MYSQL_PASSWORD="" # Mysql Password MYSQL_HOST="mariadb" # mysql host
MYSQL_PORT="3306" # default mysql port
MYSQL_USER="root" # mysql root user
MYSQL_PASSWORD="" # mysql Password
CCP_SSO_CLIENT_ID="" # Use the SSO tokens created in step 1 CCP_SSO_CLIENT_ID="" # Use the SSO tokens created in step 1
CCP_SSO_SECRET_KEY="" 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" 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_PF_DB_NAME="pathfinder" # mysql pathfinder table name
MYSQL_UNIVERSE_DB_NAME="eve_universe"
MYSQL_CCP_DB_NAME="eve_lifeblood_min"
REDIS_HOST="redis" # redis host
REDIS_PORT="6379" # default redis port
PATHFINDER_SOCKET_HOST="pathfinder-socket" # domain of the websocket container, relative to the main pf container
PATHFINDER_SOCKET_PORT="5555" # default tcp socket port
SMTP_HOST=""
SMTP_PORT=""
SMTP_SCHEME=""
SMTP_USER=""
SMTP_PASS=""
SMTP_FROM=""
SMTP_ERROR=""
> The `PROJECT_ROOT` key is the *absolute* path to the project directory, ie if you have clone it to /app/pathfinder-containers, this is the value you should enter. If you're unsure of the absolute path, you can use the command `pwd` to get the full absolute path of the current directory. > The `PROJECT_ROOT` key is the *absolute* path to the project directory, ie if you have clone it to /app/pathfinder-containers, this is the value you should enter. If you're unsure of the absolute path, you can use the command `pwd` to get the full absolute path of the current directory.
1. **Edit the *config/pathfinder/pathfinder.ini*** to your liking 1. **Edit the *config/pathfinder/pathfinder.ini*** to your liking

View file

@ -53,7 +53,7 @@ SEED = {{ md5(@SERVER.SERVER_NAME) }}
; - Cache data is stored on disc ; - Cache data is stored on disc
; redis=[SERVER] ; redis=[SERVER]
; - Cache data is stored in Redis. redis=[host]:[port]:[db]:[auth] (e.g. redis=localhost:6379:1:myPass) ; - Cache data is stored in Redis. redis=[host]:[port]:[db]:[auth] (e.g. redis=localhost:6379:1:myPass)
CACHE = redis=${CONTAINER_NAME}-redis:6379 CACHE = redis=${REDIS_HOST}:${REDIS_PORT}
; Cache backend for API data ; Cache backend for API data
; This sets the cache backend for API response data and other temp data relates to API requests. ; This sets the cache backend for API response data and other temp data relates to API requests.

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,27 +22,26 @@ 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 build:
container_name: "$CONTAINER_NAME-socket" context: '.'
command: ["sh","-c","composer install && php cmd.php --tcpHost 0.0.0.0"] dockerfile: '$PROJECT_ROOT/pf-websocket.Dockerfile'
command: ["--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:
context: '.'
dockerfile: '$PROJECT_ROOT//pathfinder.Dockerfile'
env_file: env_file:
- .env - .env
labels: labels:

View file

@ -3,8 +3,10 @@ FROM php:7.2.11-fpm-alpine3.7 as build
RUN apk update \ RUN apk update \
&& apk add --no-cache libpng-dev zeromq-dev git \ && 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 \ && docker-php-ext-install gd && docker-php-ext-install pdo_mysql && \
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer 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 COPY pathfinder /app
WORKDIR /app WORKDIR /app

7
pf-websocket.Dockerfile Normal file
View file

@ -0,0 +1,7 @@
FROM composer:2.3.10
COPY websocket /app
WORKDIR /app
RUN composer install
ENTRYPOINT ["/usr/local/bin/php", "cmd.php"]

View file

@ -2,7 +2,7 @@
set -e set -e
crontab /var/crontab.txt crontab /var/crontab.txt
envsubst '$DOMAIN' </etc/nginx/templateSite.conf >/etc/nginx/sites_enabled/site.conf envsubst '$DOMAIN' </etc/nginx/templateSite.conf >/etc/nginx/sites_enabled/site.conf
envsubst '$CONTAINER_NAME' </etc/nginx/templateNginx.conf >/etc/nginx/nginx.conf envsubst '$PATHFINDER_SOCKET_HOST' </etc/nginx/templateNginx.conf >/etc/nginx/nginx.conf
envsubst </var/www/html/pathfinder/app/templateEnvironment.ini >/var/www/html/pathfinder/app/environment.ini envsubst </var/www/html/pathfinder/app/templateEnvironment.ini >/var/www/html/pathfinder/app/environment.ini
envsubst </var/www/html/pathfinder/app/templateConfig.ini >/var/www/html/pathfinder/app/config.ini envsubst </var/www/html/pathfinder/app/templateConfig.ini >/var/www/html/pathfinder/app/config.ini
envsubst </etc/zzz_custom.ini >/etc/php7/conf.d/zzz_custom.ini envsubst </etc/zzz_custom.ini >/etc/php7/conf.d/zzz_custom.ini

View file

@ -165,7 +165,7 @@ http {
} }
upstream websocket { upstream websocket {
server ${CONTAINER_NAME}-socket:8020; server ${PATHFINDER_SOCKET_HOST}:8020;
} }

View file

@ -15,23 +15,23 @@ URL = {{@SCHEME}}://$DOMAIN
; level of debug/error stack trace ; level of debug/error stack trace
DEBUG = 0 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

@ -9,7 +9,7 @@ fastcgi.impersonate=1
fastcgi.logging=0 fastcgi.logging=0
request_terminate_timeout = 300 request_terminate_timeout = 300
session.save_handler = redis session.save_handler = redis
session.save_path = "tcp://${CONTAINER_NAME}-redis:6379" session.save_path = "tcp://${REDIS_HOST}:${REDIS_PORT}"
[Date] [Date]
date.timezone="UTC" date.timezone="UTC"