Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
WilcoApp committed Jan 4, 2024
1 parent 53a3218 commit b8e5aba
Show file tree
Hide file tree
Showing 230 changed files with 11,353 additions and 27,136 deletions.
2 changes: 2 additions & 0 deletions .devcontainer/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/data/
/www/
53 changes: 14 additions & 39 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,42 +1,17 @@
{
"name": "Anythink Development Container",
"image": "public.ecr.aws/v0a2l7y2/wilco/anythink-devcontainer:latest",
"forwardPorts": [3000, 3001, 5433, 27017],
"portsAttributes": {
"3000": {
"label": "Backend",
"elevateIfNeeded": true,
"requireLocalPort": true,
"onAutoForward": "silent"
},
"3001": {
"label": "Frontend",
"elevateIfNeeded": true,
"requireLocalPort": true,
"onAutoForward": "silent"
},
"5433": {
"label": "Database",
"elevateIfNeeded": true,
"requireLocalPort": true,
"onAutoForward": "silent"
},
"27017": {
"label": "Database",
"elevateIfNeeded": true,
"requireLocalPort": true,
"onAutoForward": "silent"
}
},
"postStartCommand": "bash -c .devcontainer/setup.sh",
"name": "laravel-fresh-install",

"settings": {
"extensions.ignoreRecommendations": true,
"workbench.startupEditor": "none",
"workbench.colorTheme": "Visual Studio Dark",
"workbench.colorCustomizations": {},
"workbench.welcomePage.walkthroughs.openOnInstall": false,
"workbench.welcomePage.experimental.videoTutorials": "off",
"github.codespaces.defaultExtensions": []
}
// "xdebug.php-debug" = official XDEBUG extension
"customizations": {
"vscode": {
"extensions": [
"xdebug.php-debug"
]
}
},

"forwardPorts": [80],

// execute our one-time repo init if /vendor/ does not exist
"postCreateCommand": "sh init_repo.sh"
}
29 changes: 0 additions & 29 deletions .devcontainer/open_port.sh

This file was deleted.

25 changes: 0 additions & 25 deletions .devcontainer/setup.sh

This file was deleted.

1 change: 1 addition & 0 deletions .docker/nginx/conf.d/error_reporting.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
error_reporting=E_ALL
38 changes: 38 additions & 0 deletions .docker/nginx/conf.d/nginx-webserver.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# this server config works with Laravel too
server {
listen 80;
listen [::]:80 default_server;

# not needed for now
# server_name example.com;

root /var/www/htdoc/public;

add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options "nosniff";

index index.php;

charset utf-8;

location / {
try_files $uri $uri/ /index.php?$query_string;
}

location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }

error_page 404 /index.php;

location ~* \.php$ {
fastcgi_pass php:9000;

include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
}

location ~ /\.(?!well-known).* {
deny all;
}
}
52 changes: 52 additions & 0 deletions .docker/php/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# defined in docker-compose.yml, from docker-env.env
ARG RUNTIME_PHP_IMAGE

# Use the specified image as the base
FROM ${RUNTIME_PHP_IMAGE}

# Update the packages
# Install system packages required for MongoDB extension
# 'mysql-client' so we can log into mysql from the PHP container with the command 'mysql -h mysql -u root -p' where mysql is the service name
# 'iputils-ping' to get the ping command
RUN apt-get update && apt-get install -y libssl-dev wget git unzip default-mysql-client iputils-ping

RUN pecl apt update \
&& apt install libzip-dev -y \
&& docker-php-ext-install zip \
&& rm -rf /var/lib/apt/lists/*

# Required for MySQL to work in PHP
RUN docker-php-ext-install mysqli && \
docker-php-ext-install pdo_mysql

# Test if already installed and
# install the <latest> mongodb PHP extension
# RUN pecl install mongodb && docker-php-ext-enable mongodb
RUN bash -c '[[ -n "$(pecl list | grep mongodb)" ]]\
|| (pecl install mongodb && docker-php-ext-enable mongodb)'

# Test if already installed and
# install and enable XDEBUG <latest>
# RUN pecl install xdebug && docker-php-ext-enable xdebug
RUN bash -c '[[ -n "$(pecl list | grep xdebug)" ]]\
|| (pecl install xdebug && docker-php-ext-enable xdebug)'

# install Redis PHP driver
RUN pecl install -o -f redis \
&& rm -rf /tmp/pear \
&& docker-php-ext-enable redis \
&& docker-php-ext-enable pdo_mysql

# Task: copy rep's PHP .ini files to be automatically parsed
#
# directory is related to the PHP service context
# dot NOT use ./filename.ext for root files
# use filename.ext
COPY .docker/php/docker-php.ini /usr/local/etc/php/conf.d/

COPY .docker/php/xdebug.ini /usr/local/etc/php/conf.d/

# Get Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer

WORKDIR /var/www/htdoc
1 change: 1 addition & 0 deletions .docker/php/docker-php.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# hubert stuff
41 changes: 41 additions & 0 deletions .docker/php/xdebug.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
; already loaded in /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
;zend_extension=xdebug

; FIXME : should be elsewhere, like docker-php.ini
error_log = /var/log/php-errors.log
catch_workers_output = yes

[xdebug]
; 'debug' means we're enabling step-by-step debugging
xdebug.mode=debug

xdebug.client_port=9003

; xdebug.client_host is the IP address of the system where VS Code runs
; that IP address is DIFFERENT depending on WHERE VS Code is launched in Windows/Mac, WSL, Container/devcontainer/codespaces
;
; the PHP container sends debugging data OUT to xdebug.client_host:xdebug.client_port


; localhost is used when running btoh VS Code and PHP from within **the same PHP container**
; after opening the project in the Container
xdebug.client_host=localhost

; if using Docker Desktop 'host.docker.internal' is supposed to hold the IP Address of
; the Docker host, but that's not always true. DOUBLE-CHECK

;xdebug.client_host=host.docker.internal

; 'yes': This will always initiate a debugging, profiling, or tracing session as soon as a request is received, without needing any specific trigger
; 'no' : This will never initiate a session regardless of the presence of any trigger
; 'trigger' : This will initiate a session only if a specific trigger, like a GET/POST variable or a cookie, is present in the request.
xdebug.start_with_request=yes

; OPTIONAL: idekey
; in the browser add a URL param , if not using a browser utility
; url.to.debug?XDEBUG_SESSION_START=PHPSTORM
; sets up a coockie called "XDEBUG_SESSION_START" with the value "PHPSTORM", which is the "trigger"
; xdebug.idekey=PHPSTORM

; defines a log file. This is created, with touch, and initialized (permissions) in the PHP container Dockerfile
xdebug.log=/tmp/xdebug.log
3 changes: 0 additions & 3 deletions .github/pull_request_template.md

This file was deleted.

Loading

0 comments on commit b8e5aba

Please sign in to comment.