Skip to content

Commit

Permalink
Merge pull request #154 from TMHBOFH/develop
Browse files Browse the repository at this point in the history
update Dockerfile, build and push Image
  • Loading branch information
bbdoc authored Aug 24, 2023
2 parents 8b23b39 + e58580f commit 33bda9d
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 20 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: publish

on: [push]

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
FROM php:7-apache
FROM php:8.1-apache

RUN rm -rf /var/www/html/*
WORKDIR /var/www/html/

# Install Node
RUN apt-get update && apt-get -y install curl gnupg
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash -
RUN curl -sL https://deb.nodesource.com/setup_18.x | bash -
RUN apt-get update && apt-get -y install nodejs

# Install PHP modules
RUN docker-php-ext-install mysqli

# Install Node depdencies
COPY package.json .
COPY package.json .
COPY config.env.php config.php
RUN npm install
# Install PoracleWeb
COPY . .
COPY . .
3 changes: 2 additions & 1 deletion discord_auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
error_reporting(E_ALL);

include_once "./config.php";
include_once "include/defaults.php";

define('OAUTH2_CLIENT_ID', $discordBotClientId); //Your client Id
define('OAUTH2_CLIENT_SECRET', $discordBotClientSecret); //Your secret client code
Expand Down Expand Up @@ -67,7 +68,7 @@
{
header("Location: $redirect_url?type=display&page=server_settings");
}
else if ( version_compare($_SESSION['poracleVersion'], @$min_poracle_version) < 0 )
else if ( version_compare($_SESSION['poracleVersion'], $min_poracle_version) < 0 )
{
header("Location: $redirect_url?type=display&page=server_settings");
}
Expand Down
29 changes: 15 additions & 14 deletions docker-compose.example.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
version: '3.1'
services:
poracle-web:
build: ./poracleWeb # folder or subfolder where poracle-web is located
image: ghcr.io/bbdoc/poracleweb:main
container_name: poracle-web
restart: unless-stopped
tty: true
environment:
PORACLE_DB_HOST: poracle-db
PORACLE_DB_DATABASE: poracledb
PORACLE_DB_USERNAME: poracleuser
PORACLE_DB_PASSWORD: dbPassword
PORACLE_DB_PORT: 3306
ADMIN_ID: 123456789123456
REDIRECT_URL: https://poracle.map.com #
DISCORD_BOT_CLIENT_ID: 123456789123456789
DISCORD_BOT_CLIENT_SECRET: abcdefghijklmnopqrstuvwxyz
MAP_URL: https://tiles.map.com/staticmap/poracle-web?img=https://raw.githubusercontent>
MAP_PORACLE_WEB: https://tiles.map.com/staticmap/poracle-web
# for the configuration you can work with environment variables or bind config.php into container
# environment:
# PORACLE_DB_HOST: poracle-db
# PORACLE_DB_DATABASE: poracledb
# PORACLE_DB_USERNAME: poracleuser
# PORACLE_DB_PASSWORD: dbPassword
# PORACLE_DB_PORT: 3306
# ADMIN_ID: 123456789123456
# REDIRECT_URL: https://poracle.map.com #
# DISCORD_BOT_CLIENT_ID: 123456789123456789
# DISCORD_BOT_CLIENT_SECRET: abcdefghijklmnopqrstuvwxyz
# MAP_URL: https://tiles.map.com/staticmap/poracle-web?img=https://raw.githubusercontent>
# MAP_PORACLE_WEB: https://tiles.map.com/staticmap/poracle-web
depends_on:
- poracle-db
- poracle
volumes:
- ./poracle/:/poracle/
# - ./config.php:/var/www/html/config.php
- /etc/localtime:/etc/localtime:ro
ports:
- 127.0.0.1:9060:80
4 changes: 3 additions & 1 deletion include/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,9 @@ function get_gym_color($id) {
function set_locale() {

global $conn;
$_SESSION['locale'] = $_SESSION['server_locale'];
if (isset($_SESSION['server_locale'])) {
$_SESSION['locale'] = $_SESSION['server_locale'];
}

if (isset($_SESSION['id'])) {
include_once "./config.php";
Expand Down

0 comments on commit 33bda9d

Please sign in to comment.