first commit
This commit is contained in:
@@ -0,0 +1,2 @@
|
|||||||
|
/data/*
|
||||||
|
/src/*
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
localhost {
|
||||||
|
root * /app/public/bedrock/web
|
||||||
|
php_fastcgi php-fpm:9000 {
|
||||||
|
index index.php
|
||||||
|
}
|
||||||
|
file_server
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
FROM mariadb:latest
|
||||||
|
COPY ./Docker/mariadb/wordpress.sql /wordpress.sql
|
||||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,28 @@
|
|||||||
|
DB_NAME='wordpress'
|
||||||
|
DB_USER='root'
|
||||||
|
DB_PASSWORD='password'
|
||||||
|
|
||||||
|
# Optionally, you can use a data source name (DSN)
|
||||||
|
# When using a DSN, you can remove the DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST variables
|
||||||
|
# DATABASE_URL='mysql://database_user:database_password@database_host:database_port/database_name'
|
||||||
|
|
||||||
|
# Optional database variables
|
||||||
|
DB_HOST='mariadb:3306'
|
||||||
|
# DB_PREFIX='wp_'
|
||||||
|
|
||||||
|
WP_ENV='development'
|
||||||
|
WP_HOME='https://localhost'
|
||||||
|
WP_SITEURL="${WP_HOME}/wp"
|
||||||
|
|
||||||
|
# Specify optional debug.log path
|
||||||
|
# WP_DEBUG_LOG='/path/to/debug.log'
|
||||||
|
|
||||||
|
# Generate your keys here: https://roots.io/salts.html
|
||||||
|
AUTH_KEY='5>dGYuaw99)JE07_[yynF9fU%<6^Erck:M624#IDTGAf2#*?:offvHD(-1)E((=}'
|
||||||
|
SECURE_AUTH_KEY='[]w#?SF3eWvt=)g%[Jr<`zNYe,q:v{R<vD^qzyfJV1[T403Z$N;4mwn1uQpItF]<'
|
||||||
|
LOGGED_IN_KEY='#IF#OjR2Za7,6=M8m`{:k^k.x@uT5Uv{wA!DuX$!GmyDQ/4l[eGR$R4xKzwb_2|)'
|
||||||
|
NONCE_KEY='c/S[x@|I?D=xuUMWZ6Ry2,myJEJ!y^Ah&t205{jx|vNvOkF:s[B(RJj$H6Y|mS3?'
|
||||||
|
AUTH_SALT='F>2:thG6Td;98S}.Fq5(!2t(R|n0mXU#2%&A{^;EN_GUCs_}ma|jQ&k]Y+/7)g3U'
|
||||||
|
SECURE_AUTH_SALT='[E}ZJfwaKeJ*GnjyD:UN(|lrF`uHcmIJVu+Qusbl!_aXl4!+PUM%7O6;q4;S(Q7V'
|
||||||
|
LOGGED_IN_SALT=',dvcC]!(9l4XDVt.?a%RJC%0`A[|hf>UjqOol_fk^N%6Ori2hF9cX/%wKsRN_6%f'
|
||||||
|
NONCE_SALT='?tXJ#$rYP*]iB|i!MsYaf*erF=.AU;wFyl%XK7yA2AKIl5gYmVy)rwg`&u[^h.vf'
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
FROM php:8.1-fpm-alpine
|
||||||
|
|
||||||
|
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
|
||||||
|
RUN chmod +x /usr/local/bin/install-php-extensions && \
|
||||||
|
install-php-extensions mysqli exif imagick zip memcached opcache redis intl xdebug && \
|
||||||
|
echo "xdebug.mode=debug" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini && \
|
||||||
|
echo "xdebug.client_host=host.docker.internal" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
|
||||||
|
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
|
||||||
|
RUN apk add --update nodejs npm
|
||||||
|
WORKDIR /app/public
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
/**
|
||||||
|
* Compiler configuration
|
||||||
|
*
|
||||||
|
* @see {@link https://roots.io/docs/sage sage documentation}
|
||||||
|
* @see {@link https://bud.js.org/guides/configure bud.js configuration guide}
|
||||||
|
*
|
||||||
|
* @param {import('@roots/bud').Bud} app
|
||||||
|
*/
|
||||||
|
export default async (app) => {
|
||||||
|
/**
|
||||||
|
* Application assets & entrypoints
|
||||||
|
*
|
||||||
|
* @see {@link https://bud.js.org/docs/bud.entry}
|
||||||
|
* @see {@link https://bud.js.org/docs/bud.assets}
|
||||||
|
*/
|
||||||
|
app
|
||||||
|
.entry('app', ['@scripts/app', '@styles/app'])
|
||||||
|
.entry('editor', ['@scripts/editor', '@styles/editor'])
|
||||||
|
.assets(['images']);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set public path
|
||||||
|
*
|
||||||
|
* @see {@link https://bud.js.org/docs/bud.setPublicPath}
|
||||||
|
*/
|
||||||
|
app.setPublicPath('/app/themes/sage/public/');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Development server settings
|
||||||
|
*
|
||||||
|
* @see {@link https://bud.js.org/docs/bud.setUrl}
|
||||||
|
* @see {@link https://bud.js.org/docs/bud.setProxyUrl}
|
||||||
|
* @see {@link https://bud.js.org/docs/bud.watch}
|
||||||
|
*/
|
||||||
|
app
|
||||||
|
.setUrl('http://localhost')
|
||||||
|
.setProxyUrl('http://example.test')
|
||||||
|
.watch(['resources/views', 'app']);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate WordPress `theme.json`
|
||||||
|
*
|
||||||
|
* @note This overwrites `theme.json` on every build.
|
||||||
|
*
|
||||||
|
* @see {@link https://bud.js.org/extensions/sage/theme.json}
|
||||||
|
* @see {@link https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-json}
|
||||||
|
*/
|
||||||
|
app.wpjson
|
||||||
|
.set('settings.color.custom', false)
|
||||||
|
.set('settings.color.customDuotone', false)
|
||||||
|
.set('settings.color.customGradient', false)
|
||||||
|
.set('settings.color.defaultDuotone', false)
|
||||||
|
.set('settings.color.defaultGradients', false)
|
||||||
|
.set('settings.color.defaultPalette', false)
|
||||||
|
.set('settings.color.duotone', [])
|
||||||
|
.set('settings.custom.spacing', {})
|
||||||
|
.set('settings.custom.typography.font-size', {})
|
||||||
|
.set('settings.custom.typography.line-height', {})
|
||||||
|
.set('settings.spacing.padding', true)
|
||||||
|
.set('settings.spacing.units', ['px', '%', 'em', 'rem', 'vw', 'vh'])
|
||||||
|
.set('settings.typography.customFontSize', false)
|
||||||
|
.useTailwindColors()
|
||||||
|
.useTailwindFontFamily()
|
||||||
|
.useTailwindFontSize()
|
||||||
|
.enable();
|
||||||
|
};
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
FROM redis:4
|
||||||
|
|
||||||
|
COPY ./Docker/redis/redis.conf /usr/local/etc/redis/redis.conf
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
save ""
|
||||||
|
appendonly no
|
||||||
|
maxmemory-policy allkeys-lru
|
||||||
|
maxmemory 64mb
|
||||||
|
protected-mode no
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
#!/usr/bin/make
|
||||||
|
|
||||||
|
build_stack:
|
||||||
|
docker-compose build && \
|
||||||
|
docker-compose up -d
|
||||||
|
|
||||||
|
build_bedrock:
|
||||||
|
docker exec -it -u root php-fpm sh -c \
|
||||||
|
"chown -R 1000:1000 /app/public && \
|
||||||
|
npm install --global yarn && \
|
||||||
|
touch /.yarnrc && \
|
||||||
|
chown 1000 /.yarnrc && \
|
||||||
|
chmod +r /.yarnrc && \
|
||||||
|
mkdir /.cache && \
|
||||||
|
chown 1000 /.cache && \
|
||||||
|
chmod +r /.cache"
|
||||||
|
docker exec -it -w /app/public php-fpm sh -c \
|
||||||
|
"composer create-project roots/bedrock &&\
|
||||||
|
cd bedrock && \
|
||||||
|
composer update && \
|
||||||
|
composer require roots/acorn && \
|
||||||
|
composer require wpackagist-plugin/redis-cache && \
|
||||||
|
echo \"define('WP_REDIS_HOST', 'redis');\" >> /app/public/bedrock/config/application.php && \
|
||||||
|
echo \"define('WP_REDIS_PORT', '6379');\" >> /app/public/bedrock/config/application.php" && \
|
||||||
|
cp Docker/php/.env src/bedrock/.env && \
|
||||||
|
|
||||||
|
build_theme:
|
||||||
|
docker exec -it -w /app/public/bedrock/web/app/themes php-fpm sh -c \
|
||||||
|
"composer create-project roots/sage partition-jlg-theme" && \
|
||||||
|
cp Docker/php/bud.config.js src/bedrock/web/app/themes/partition-jlg-theme/bud.config.js && \
|
||||||
|
docker exec -it -w /app/public/bedrock/web/app/themes/partition-jlg-theme php-fpm sh -c \
|
||||||
|
"yarn && \
|
||||||
|
yarn build"
|
||||||
|
|
||||||
|
install_theme:
|
||||||
|
docker exec -it -w /app/public/bedrock/web/app/themes/partition-jlg-theme php-fpm sh -c \
|
||||||
|
"yarn && \
|
||||||
|
yarn build"
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
# installation
|
||||||
|
|
||||||
|
0. docker et docker-compose installés sur le host
|
||||||
|
1. cloner la stack
|
||||||
|
- `git clone`
|
||||||
|
2. build la stack `make build_stack`
|
||||||
|
3. build bedrock `make build_bedrock`
|
||||||
|
4. installer la db
|
||||||
|
- `docker exec -it mariadb /bin/sh`
|
||||||
|
- `mysql -u root -p --force --one-database wordpress < /wordpress.sql`
|
||||||
|
- prompt password db `password`
|
||||||
|
- `exit`
|
||||||
|
5. activer redis dans l'admin wordpress
|
||||||
|
- `plugins -> installed plugins`
|
||||||
|
- `settings -> redis`
|
||||||
|
4. cloner le thème
|
||||||
|
- `cd src/bedrock/web/app/themes/`
|
||||||
|
- `git submodule add LIEN`
|
||||||
|
5. installer le thème `make install_theme`
|
||||||
|
|
||||||
|
|
||||||
|
# xdebug
|
||||||
|
|
||||||
|
- Installer l'extension Codium / VSCode PHP Debug
|
||||||
|
- Mapping dans .vscode
|
||||||
|
- Installer l'extension de navigateur Xdebug
|
||||||
|
|
||||||
|
|
||||||
|
# phpmyadmin
|
||||||
|
|
||||||
|
Marche pas
|
||||||
|
|
||||||
|
|
||||||
|
# todo stack
|
||||||
|
|
||||||
|
urgent
|
||||||
|
- workflow installation / dev / collaboration
|
||||||
|
- variables d'environnement
|
||||||
|
- makefile
|
||||||
|
- readme
|
||||||
|
- depot git submodule
|
||||||
|
- dump db
|
||||||
|
|
||||||
|
debug
|
||||||
|
- pb https
|
||||||
|
- phpmyadmin
|
||||||
|
|
||||||
|
plus tard
|
||||||
|
- passwords -> redis, mariadb, phpmyadmin
|
||||||
|
- installer, documenter xdebug
|
||||||
|
- redis as muplugin
|
||||||
|
- installer matomo
|
||||||
|
- composer install au lieu de bash script
|
||||||
|
- déploiement
|
||||||
|
|
||||||
|
|
||||||
|
# ressources
|
||||||
|
|
||||||
|
- Sage
|
||||||
|
https://toby.ink/blog/2020/11/26/dummys-guide-to-roots-sage-theme-in-wordpress
|
||||||
|
|
||||||
|
|
||||||
|
# dump db
|
||||||
|
|
||||||
|
- `docker exec -it mariadb /bin/sh`
|
||||||
|
- `mysqldump -u root -p wordpress > /var/lib/mysql/wordpress.sql`
|
||||||
|
- `exit`
|
||||||
|
- `sudo mv data/wordpress.sql ./Docker/mariadb/wordpress.sql`
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
services:
|
||||||
|
caddy:
|
||||||
|
container_name: caddy
|
||||||
|
image: caddy
|
||||||
|
restart: unless-stopped
|
||||||
|
ports:
|
||||||
|
- "80:80"
|
||||||
|
- "443:443"
|
||||||
|
volumes:
|
||||||
|
- ./Caddyfile:/etc/caddy/Caddyfile
|
||||||
|
- ./src:/app/public
|
||||||
|
networks:
|
||||||
|
- internal
|
||||||
|
depends_on:
|
||||||
|
- php-fpm
|
||||||
|
|
||||||
|
php-fpm:
|
||||||
|
user: 1000:1000
|
||||||
|
container_name: php-fpm
|
||||||
|
build:
|
||||||
|
dockerfile: ./Docker/php/Dockerfile
|
||||||
|
restart: unless-stopped
|
||||||
|
extra_hosts:
|
||||||
|
- host.docker.internal:host-gateway # pour xdebug
|
||||||
|
volumes:
|
||||||
|
- ./src:/app/public
|
||||||
|
networks:
|
||||||
|
- internal
|
||||||
|
- redis
|
||||||
|
|
||||||
|
mariadb:
|
||||||
|
container_name: mariadb
|
||||||
|
build:
|
||||||
|
dockerfile: ./Docker/mariadb/Dockerfile
|
||||||
|
environment:
|
||||||
|
- MYSQL_ROOT_PASSWORD=password
|
||||||
|
- MYSQL_DATABASE=wordpress
|
||||||
|
volumes:
|
||||||
|
- ./data:/var/lib/mysql
|
||||||
|
networks:
|
||||||
|
- internal
|
||||||
|
|
||||||
|
redis:
|
||||||
|
user: 1000:1000
|
||||||
|
container_name: redis
|
||||||
|
build:
|
||||||
|
dockerfile: ./Docker/redis/Dockerfile
|
||||||
|
command: ["redis-server", "/usr/local/etc/redis/redis.conf"]
|
||||||
|
ports:
|
||||||
|
- "6379:6379"
|
||||||
|
restart: always
|
||||||
|
networks:
|
||||||
|
- redis
|
||||||
|
|
||||||
|
phpmyadmin:
|
||||||
|
container_name: phpmyadmin
|
||||||
|
image: phpmyadmin/phpmyadmin
|
||||||
|
ports:
|
||||||
|
- 8080:80
|
||||||
|
networks:
|
||||||
|
- internal
|
||||||
|
environment:
|
||||||
|
PMA_HOST: mariadb
|
||||||
|
PMA_PORT: 3306
|
||||||
|
PMA_USER: root
|
||||||
|
PMA_PASSWORD: password
|
||||||
|
depends_on:
|
||||||
|
- mariadb
|
||||||
|
|
||||||
|
networks:
|
||||||
|
internal:
|
||||||
|
driver: bridge
|
||||||
|
redis:
|
||||||
Reference in New Issue
Block a user