Skip to content

Commit

Permalink
fix issues with nginx
Browse files Browse the repository at this point in the history
  • Loading branch information
xmnlab committed Nov 14, 2023
1 parent faf751b commit 0eb4565
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 8 deletions.
14 changes: 14 additions & 0 deletions .containers-sugar.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 1.0
compose-app: docker compose
env-file: ./src/.env
defaults:
group: dev
project-name: rinchen
service-groups:
- name: dev
compose-path: containers/docker-compose.yaml
env-file: ./src/.env
services:
default: web
available:
- name: web
2 changes: 2 additions & 0 deletions conda/dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@ dependencies:
- python
- pip
- makim 1.8.3
- containers-sugar 1.9.0
- pip:
- pygments
- compose-go>=1.23
20 changes: 18 additions & 2 deletions containers/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,18 @@
FROM httpd:2.4
COPY ./public-html/ /usr/local/apache2/htdocs/
FROM webdevops/php-nginx:7.4

ARG UID=1000
ARG GID=1000

RUN apt-get update -y \
&& apt-get install -y \
sudo \
tzdata \
openssl \
&& rm -rf /var/lib/apt/lists/* \
/var/cache/apt/archives \
/tmp/*

# RUN addgroup --gid ${GID} devops \
# && useradd --uid ${UID} --gid ${GID} -ms /bin/bash devops \
# && echo "devops ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/devops \
# && chmod 0440 /etc/sudoers.d/devops
14 changes: 9 additions & 5 deletions containers/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
version: '3.3'

services:
my-apache2:
web:
build:
context: .
dockerfile: ./Dockerfile
context: ..
dockerfile: ./containers/Dockerfile
args:
- UID=${UID}
- GID=${GID}
ports:
- 8080:80
- ${HOST_PORT}:80
user: "${UID}:${GID}"
volumes:
- ./public-html:/usr/local/apache2/htdocs/
- ../src:/app
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

require_once "./lib/settings.php";
require_once dirname(__DIR__) . "/lib/settings.php";

global $BASE_URL;

Expand Down
4 changes: 4 additions & 0 deletions src/lib/qr.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ function generate_qr(string $fullname, string $email, string $phone): string {

$endpoint = "$root_url/attendance_log.php";

// todo: it shouldn't have this / after the $endpoint
// this works on apache but not on nginx
// as a workaround we needed to create a folder called attendance_log.php
// and we created a file called index.php
$page_url = "$endpoint/?fullname=$fullname&email=$email&phone=$phone";

$qr_url_with_data = "$qr_url=" . urlencode($page_url);
Expand Down

0 comments on commit 0eb4565

Please sign in to comment.