Skip to content

Commit

Permalink
update Dockerfile, build and push Image
Browse files Browse the repository at this point in the history
  • Loading branch information
TMH committed Aug 17, 2023
1 parent 8b23b39 commit d70a749
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 6 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
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 d70a749

Please sign in to comment.