adds development versions

This commit is contained in:
soneill 2021-09-05 13:27:54 +12:00
parent 790407f552
commit 36f977d0b3
13 changed files with 223 additions and 483 deletions

View file

@ -0,0 +1,9 @@
CONTAINER_NAME="pfdev"
DOMAIN="localhost"
SERVER_NAME="PFDEV"
APP_PASSWORD="DEVPASSWORD"
MYSQL_PASSWORD="PASSWORD"
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"
XDEBUG_CONFIG="remote_host=host.docker.internal remote_port=9000 remote_enable=1"

View file

@ -0,0 +1,49 @@
FROM php:7.2.5-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 1.6.3
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
COPY static/nginx/nginx.conf /etc/nginx/templateNginx.conf
COPY static/nginx/site.conf /etc/nginx/sites_enabled/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"]

9
development/development.sh Executable file
View file

@ -0,0 +1,9 @@
#!/usr/bin/env bash
mv ./docker-compose.yml ./docker-compose.production.yml
mv ./Dockerfile ./Dockerfile.production
cp ./deployment/docker-compose.development.yml ./docker-compose.yml
cp ./deployment/Dockerfile.development ./Dockerfile
mkdir -p .vscode && cp ./deployment/launch.json ./.vscode/launch.json
echo "path=\"$(pwd)\"" > ./.env
cat ./deployment/.env.development >> ./.env

View file

@ -0,0 +1,101 @@
version: "3.8"
services:
pfdb:
image: bianjp/mariadb-alpine:latest
environment:
MYSQL_ROOT_PASSWORD: $MYSQL_PASSWORD
container_name: "$CONTAINER_NAME-db"
networks:
pf:
aliases:
- "${CONTAINER_NAME}db"
volumes:
- db_data:/var/lib/mysql
- $path/pathfinder/export/sql/eve_universe.sql.zip:/eve_universe.sql.zip
restart: always
pf-redis:
image: redis:6.2.5-alpine3.14
container_name: "$CONTAINER_NAME-redis"
command: ["redis-server", "--appendonly", "yes"]
hostname: redis
volumes:
- redis_data:/data
networks:
pf:
aliases:
- "$CONTAINER_NAME-redis"
logging:
driver: none
restart: always
pf-socket:
image: composer:composer@sha256:d374b2e1f715621e9d9929575d6b35b11cf4a6dc237d4a08f2e6d1611f534675
container_name: "$CONTAINER_NAME-socket"
command: ["sh","-c","composer install && php cmd.php --tcpHost 0.0.0.0"]
hostname: socket
volumes:
- ${path}/websocket:/app
networks:
pf:
aliases:
- "$CONTAINER_NAME-socket"
restart: always
pf:
container_name: ${CONTAINER_NAME}
hostname: "pathfinder"
build: '.'
env_file:
- .env
labels:
- "traefik.enable=true"
- "traefik.docker.network=web"
- "traefik.http.services.pf.loadbalancer.server.port=80"
- "traefik.http.routers.pf.rule=Host(`${DOMAIN}`)"
- "traefik.http.routers.pf.entrypoints=web"
- "traefik.http.routers.pf-secure.rule=Host(`${DOMAIN}`)"
- "traefik.http.routers.pf-secure.entrypoints=websecure"
- "traefik.http.routers.pf-secure.tls=true"
- "traefik.http.middlewares.redirecthttps.redirectscheme.scheme=https"
- "traefik.http.routers.pf.middlewares=redirecthttps"
networks:
- pf
- web
healthcheck:
disable: true
volumes:
- ${path}/config/pathfinder/config.ini:/var/www/html/pathfinder/app/templateConfig.ini
- ${path}/config/pathfinder/pathfinder.ini:/var/www/html/pathfinder/app/pathfinder.ini
- ${path}/config/pathfinder/plugin.ini:/var/www/html/pathfinder/app/plugin.ini
depends_on:
- pfdb
- pf-redis
- pf-socket
restart: always
traefik:
image: "traefik:v2.3"
container_name: "traefik"
command:
- "--log.level=ERROR"
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
ports:
- "80:80"
- "443:443"
- "8080:8080"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
networks:
- web
restart: always
volumes:
data:
db_data:
redis_data:
networks:
pf:
web:
external: true

15
development/launch.json Normal file
View file

@ -0,0 +1,15 @@
{
"version": "0.2.0",
"configurations": [{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9000,
"log": true,
"externalConsole": false,
"pathMappings": {
"/var/www/html/pathfinder": "${workspaceRoot}/pathfinder",
}
},
]
}