Compare commits
No commits in common. 'develop' and 'main' have entirely different histories.
@ -1,2 +0,0 @@
|
|||||||
# Ignore all websites in the container, these will be independantly checked out (different git repo)
|
|
||||||
php/www
|
|
||||||
@ -1,5 +0,0 @@
|
|||||||
# Ignore everything in this directory
|
|
||||||
*
|
|
||||||
# Except this file
|
|
||||||
!.gitignore
|
|
||||||
|
|
||||||
@ -1,30 +0,0 @@
|
|||||||
-- Create a user (or more)
|
|
||||||
CREATE OR REPLACE USER nathan@'%' IDENTIFIED BY 'password';
|
|
||||||
CREATE USER 'aLeaf'@'%' IDENTIFIED BY "aLeaf";
|
|
||||||
|
|
||||||
-- Role admin, only they have permission to add others to their role
|
|
||||||
CREATE OR REPLACE ROLE admin WITH ADMIN nathan@'%';
|
|
||||||
GRANT ALL ON *.* TO admin WITH GRANT OPTION;
|
|
||||||
-- GRANT ALL PRIVILEGES ON *.* TO admin WITH GRANT OPTION;
|
|
||||||
|
|
||||||
CREATE DATABASE 'aNetwork';
|
|
||||||
GRANT ALL PRIVILEGES ON 'aNetwork'.* TO 'aLeaf'@'%'; -- The user the website is using for access
|
|
||||||
|
|
||||||
-- GRANT ALL PRIVILEGES ON *.* TO 'nathan'@'%' WITH GRANT OPTION; -- Priv, all of the belo
|
|
||||||
-- GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES ON *.* TO 'username'@'localhost';
|
|
||||||
-- GRANT USAGE ON *.* TO 'nathan'@'%'; -- Allows usage of the tables I guess (default on create?)
|
|
||||||
|
|
||||||
-- https://stackoverflow.com/questions/64653778/why-are-not-working-my-roles-in-my-mysql-database
|
|
||||||
SET DEFAULT ROLE admin FOR nathan; -- https://mariadb.com/kb/en/set-default-role/
|
|
||||||
-- SET ROLE ALL;
|
|
||||||
FLUSH PRIVILEGES;
|
|
||||||
|
|
||||||
-- Remove root, to prevent root login (security, yo)
|
|
||||||
DROP USER root, root@localhost
|
|
||||||
|
|
||||||
-- Create tables, and insert data into them
|
|
||||||
-- USE ecomdb; -- This is setup by default mariadb compose
|
|
||||||
|
|
||||||
-- CREATE TABLE products (id mediumint(8) unsigned NOT NULL auto_increment,Name varchar(255) default NULL,Price varchar(255) default NULL, ImageUrl varchar(255) default NULL,PRIMARY KEY (id)) AUTO_INCREMENT=1;
|
|
||||||
|
|
||||||
-- INSERT INTO products (Name,Price,ImageUrl) VALUES ("Laptop","100","c-1.png"),("Drone","200","c-2.png"),("VR","300","c-3.png"),("Tablet","50","c-5.png"),("Watch","90","c-6.png"),("Phone Covers","20","c-7.png"),("Phone","80","c-8.png"),("Laptop","150","c-4.png");
|
|
||||||
@ -1,54 +0,0 @@
|
|||||||
# sudo docker compose down && sudo docker compose build --no-cache && sudo docker compose up -d --force-recreate
|
|
||||||
services:
|
|
||||||
nginx:
|
|
||||||
build: ./nginx
|
|
||||||
#image: nginx:1.27.1 #nginx:latest
|
|
||||||
container_name: aLeaf-nginx
|
|
||||||
#ports:
|
|
||||||
# - 84:80
|
|
||||||
restart: always
|
|
||||||
volumes:
|
|
||||||
- ./php/www:/var/www/html/
|
|
||||||
# This will overwrite default.conf with the one on the container, BUT "COPY" in dockerfile makes it ours by default
|
|
||||||
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf
|
|
||||||
|
|
||||||
php:
|
|
||||||
build: ./php
|
|
||||||
#image: php:8.3-fpm
|
|
||||||
container_name: aLeaf-php
|
|
||||||
expose:
|
|
||||||
- 9000
|
|
||||||
volumes:
|
|
||||||
- ./php/www:/var/www/html/
|
|
||||||
|
|
||||||
db:
|
|
||||||
#build: ./db
|
|
||||||
image: mariadb:10.7
|
|
||||||
container_name: aLeaf-mariadb
|
|
||||||
volumes:
|
|
||||||
#- ./db/mysql:/var/lib/mysql # If sharing from windows host, not gonna work. Needs to be on unixFS
|
|
||||||
- /home/nathan/docker_vol/aleaf_mariadb:/var/lib/mysql
|
|
||||||
# bind-mount any sql files that should be run while initializing
|
|
||||||
# Can omit create database as done via environment
|
|
||||||
- ./db/schema.sql:/docker-entrypoint-initdb.d/schema.sql
|
|
||||||
expose:
|
|
||||||
- 3306
|
|
||||||
environment:
|
|
||||||
MYSQL_ROOT_PASSWORD: mariadb
|
|
||||||
MYSQL_DATABASE: ecomdb
|
|
||||||
|
|
||||||
adminer:
|
|
||||||
container_name: aLeaf-adminer
|
|
||||||
image: adminer
|
|
||||||
restart: always
|
|
||||||
#ports:
|
|
||||||
# - "4141:4141"
|
|
||||||
# - "8080:8080"
|
|
||||||
environment:
|
|
||||||
ADMINER_DEFAULT_SERVER: aLeaf-mariadb
|
|
||||||
|
|
||||||
# docker network create -d bridge proxy # Shared with the NPM instance
|
|
||||||
networks:
|
|
||||||
default:
|
|
||||||
external: true
|
|
||||||
name: proxy
|
|
||||||
@ -1,2 +0,0 @@
|
|||||||
FROM nginx:1.27.1
|
|
||||||
COPY ./default.conf /etc/nginx/conf.d/default.conf
|
|
||||||
@ -1,56 +0,0 @@
|
|||||||
server {
|
|
||||||
listen 80 default_server;
|
|
||||||
|
|
||||||
server_name localhost aLeaf.local;
|
|
||||||
root /var/www/html/website/public;
|
|
||||||
index index.php index.html;
|
|
||||||
|
|
||||||
error_log /var/log/nginx/error.log;
|
|
||||||
access_log /var/log/nginx/access.log;
|
|
||||||
|
|
||||||
sendfile off;
|
|
||||||
|
|
||||||
client_max_body_size 100m;
|
|
||||||
|
|
||||||
location / {
|
|
||||||
try_files $uri $uri/ /index.php?$query_string;
|
|
||||||
}
|
|
||||||
|
|
||||||
location ~ \.php$ {
|
|
||||||
include fastcgi_params;
|
|
||||||
fastcgi_pass php:9000;
|
|
||||||
fastcgi_index index.php;
|
|
||||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
|
||||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
# Add a second, third, etc site like below
|
|
||||||
# server {
|
|
||||||
# listen 80; # Listening port, keep 80
|
|
||||||
|
|
||||||
# server_name aBasicPHP.local; # Server name, change to the domain name of the site
|
|
||||||
# root /var/www/html/basic; # Where the files for the site are (within container)
|
|
||||||
# index index.php index.html;
|
|
||||||
|
|
||||||
# error_log /var/log/nginx/error.log;
|
|
||||||
# access_log /var/log/nginx/access.log;
|
|
||||||
|
|
||||||
# sendfile off;
|
|
||||||
|
|
||||||
# client_max_body_size 100m;
|
|
||||||
|
|
||||||
# location / {
|
|
||||||
# try_files $uri $uri/ /index.php?$query_string;
|
|
||||||
# }
|
|
||||||
|
|
||||||
# location ~ \.php$ {
|
|
||||||
# include fastcgi_params;
|
|
||||||
# fastcgi_pass php:9000;
|
|
||||||
# fastcgi_index index.php;
|
|
||||||
# fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
|
||||||
# fastcgi_param PATH_INFO $fastcgi_path_info;
|
|
||||||
# }
|
|
||||||
|
|
||||||
# }
|
|
||||||
@ -1,30 +0,0 @@
|
|||||||
FROM php:8.3-fpm
|
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
||||||
libzip-dev \
|
|
||||||
wget \
|
|
||||||
git \
|
|
||||||
unzip
|
|
||||||
|
|
||||||
RUN docker-php-ext-install zip pdo pdo_mysql mysqli
|
|
||||||
RUN docker-php-ext-enable mysqli
|
|
||||||
|
|
||||||
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
|
||||||
|
|
||||||
RUN composer global require leafs/cli -W
|
|
||||||
|
|
||||||
RUN ln -s /root/.composer/vendor/bin/leaf /usr/local/bin/leaf
|
|
||||||
|
|
||||||
# If you have a custom PHP ini file you can uncomment this line
|
|
||||||
# COPY ./php.ini /usr/local/etc/php/php.ini
|
|
||||||
|
|
||||||
RUN apt-get purge -y g++ \
|
|
||||||
&& apt-get autoremove -y \
|
|
||||||
&& rm -rf /var/lib/apt/lists/* \
|
|
||||||
&& rm -rf /tmp/*
|
|
||||||
|
|
||||||
WORKDIR /var/www
|
|
||||||
|
|
||||||
# RUN chown -R www-data:www-data /var/www
|
|
||||||
|
|
||||||
CMD ["php-fpm"]
|
|
||||||
@ -1 +0,0 @@
|
|||||||
# If using a custom php.ini throw it here (after the container has run, then restart)
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
<?php
|
|
||||||
phpinfo();
|
|
||||||
?>
|
|
||||||
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
sass --no-source-map --style compressed \
|
|
||||||
--watch php/www/website/public/assets/aSkelly/scss:php/www/website/public/assets/aSkelly/css
|
|
||||||
|
|
||||||
Loading…
Reference in New Issue