1
0
Fork 0
mirror of https://github.com/Alamantus/Lexiconga.git synced 2025-08-01 19:47:34 +02:00

Set up a docker file so I don't have to install PHP

This commit is contained in:
Robbie Antenesse 2025-06-15 11:01:11 -06:00
parent 70871478ca
commit 6441a0546b
8 changed files with 68 additions and 6538 deletions

5
.env.example Normal file
View file

@ -0,0 +1,5 @@
PROJECT_DB_ROOT_PASSWORD=user_password
PROJECT_DB_DATABASE=lexiconga_db_name
PROJECT_DB_USER=lexiconga_db_username
# For local development, it should be fine to share root and regular password
PROJECT_DB_PASSWORD=${PROJECT_DB_ROOT_PASSWORD}

6
.gitignore vendored
View file

@ -1,8 +1,14 @@
node_modules/
.cache/
dist/
html/
vendor/
processedImages/
*lock*
.env*
!.env*.example
.DS_Store
src/php/api/config.php
src/php/api/migrate.php

16
Dockerfile Normal file
View file

@ -0,0 +1,16 @@
FROM php:8.2-apache
# Enable Apache modules
RUN a2enmod rewrite
# Install composer dependencies
RUN apt update && apt upgrade -y && apt install -y git curl libzip-dev zip unzip
# Install Node
RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
RUN apt update && apt-get install -y nodejs
# Install any extensions you need
RUN docker-php-ext-install mysqli pdo pdo_mysql zip
# Install Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# Set the working directory to /var/www
WORKDIR /var/www
# Copy the source code into the container at /var/www
COPY ./ .

131
composer.lock generated
View file

@ -1,131 +0,0 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "b2cfd40da6d3f90b0110c83afb8c3c0e",
"packages": [
{
"name": "firebase/php-jwt",
"version": "v5.0.0",
"source": {
"type": "git",
"url": "https://github.com/firebase/php-jwt.git",
"reference": "9984a4d3a32ae7673d6971ea00bae9d0a1abba0e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/firebase/php-jwt/zipball/9984a4d3a32ae7673d6971ea00bae9d0a1abba0e",
"reference": "9984a4d3a32ae7673d6971ea00bae9d0a1abba0e",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"require-dev": {
"phpunit/phpunit": " 4.8.35"
},
"type": "library",
"autoload": {
"psr-4": {
"Firebase\\JWT\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Neuman Vong",
"email": "neuman+pear@twilio.com",
"role": "Developer"
},
{
"name": "Anant Narayanan",
"email": "anant@php.net",
"role": "Developer"
}
],
"description": "A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.",
"homepage": "https://github.com/firebase/php-jwt",
"time": "2017-06-27T22:17:23+00:00"
},
{
"name": "hashids/hashids",
"version": "4.0.0",
"source": {
"type": "git",
"url": "https://github.com/ivanakimov/hashids.php.git",
"reference": "43bb2407f16a631f0128f47bcb67ff986c63dde2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ivanakimov/hashids.php/zipball/43bb2407f16a631f0128f47bcb67ff986c63dde2",
"reference": "43bb2407f16a631f0128f47bcb67ff986c63dde2",
"shasum": ""
},
"require": {
"ext-mbstring": "*",
"php": "^7.2"
},
"require-dev": {
"phpunit/phpunit": "^8.0"
},
"suggest": {
"ext-bcmath": "Required to use BC Math arbitrary precision mathematics (*).",
"ext-gmp": "Required to use GNU multiple precision mathematics (*)."
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.0-dev"
}
},
"autoload": {
"psr-4": {
"Hashids\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Ivan Akimov",
"email": "ivan@barreleye.com",
"homepage": "https://twitter.com/IvanAkimov"
},
{
"name": "Vincent Klaiber",
"email": "hello@doubledip.se",
"homepage": "https://doubledip.se"
}
],
"description": "Generate short, unique, non-sequential ids (like YouTube and Bitly) from numbers",
"homepage": "http://hashids.org/php",
"keywords": [
"bitly",
"decode",
"encode",
"hash",
"hashid",
"hashids",
"ids",
"obfuscate",
"youtube"
],
"time": "2019-04-03T13:40:29+00:00"
}
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform-dev": []
}

34
docker-compose.yml Normal file
View file

@ -0,0 +1,34 @@
services:
server:
build:
context: .
dockerfile: Dockerfile
command: bash -c "composer install && npm install && apache2-foreground"
links:
- db
volumes:
- ./:/var/www
ports:
- 8000:80
depends_on:
- db
db:
image: mariadb:10.6.21
environment:
MARIADB_ROOT_PASSWORD: ${PROJECT_DB_ROOT_PASSWORD}
MARIADB_DATABASE: ${PROJECT_DB_DATABASE}
MARIADB_USER: ${PROJECT_DB_USER}
MARIADB_PASSWORD: ${PROJECT_DB_PASSWORD}
ports:
- "3306:3306"
phpmyadmin:
image: phpmyadmin/phpmyadmin
links:
- db
ports:
- "8081:80"
environment:
PMA_HOST: db
MYSQL_ROOT_PASSWORD: ${PROJECT_DB_ROOT_PASSWORD}

View file

@ -8,16 +8,16 @@
"license": "UNLICENCED",
"scripts": {
"dev": "npm run process-images && concurrently \"npm run watch-js\" \"npm run watch-php\" \"npm run copy-files\"",
"watch-js": "parcel watch template-index.html offline.html template-view.html template-passwordreset.html --no-hmr --public-url /lexiconga/",
"watch-php": "cpx \"src/php/**/{*,.*}\" dist -v -w",
"watch-js": "parcel watch template-index.html offline.html template-view.html template-passwordreset.html --no-hmr",
"watch-php": "cpx \"src/php/**/{*,.*}\" html -v -w",
"build": "npm run process-images && npm run bundle-js && npm run copy-files && npm run copy-php",
"bundle-js": "parcel build template-index.html offline.html template-view.html template-passwordreset.html --no-source-maps",
"copy-files": "cpx \"node_modules/upup/dist/*.min.js\" dist -v",
"copy-php": "cpx \"src/php/**/{*,.*}\" dist",
"bundle-js": "parcel build template-index.html offline.html template-view.html template-passwordreset.html --no-source-maps --out-dir html",
"copy-files": "cpx \"node_modules/upup/dist/*.min.js\" html -v",
"copy-php": "cpx \"src/php/**/{*,.*}\" html",
"process-images": "node dev/resize-images.js",
"serve-frontend-only": "parcel template-index.html",
"clear": "npm run clear-dist && npm run clear-cache",
"clear-dist": "rimraf dist/{*,.*}",
"clear-dist": "rimraf html/{*,.*}",
"clear-cache": "rimraf .cache/{*,.*}"
},
"devDependencies": {

View file

@ -13,7 +13,7 @@ export default function migrate() {
}
function isNotSecure() {
return window.location.host !== 'localhost' && window.location.protocol !== 'https:';
return !window.location.host.startsWith('localhost') && window.location.protocol !== 'https:';
}
function sendDictionaryToHTTPS() {

6400
yarn.lock

File diff suppressed because it is too large Load diff