add: wordpress docker

This commit is contained in:
mcolonna 2025-06-09 15:37:05 +02:00
parent 2484c20af5
commit aa2a0d6f71
11 changed files with 137 additions and 159 deletions

View file

@ -6,8 +6,25 @@ services:
build: ./requirements/nginx/
ports:
- 4433:443
depends_on:
- wordpress
volumes:
- www:/www:ro
# domainname: mcolonna.42.fr # TODO(vm) useful? # TODO(any)(nocopy)
wordpress:
build: ./requirements/wordpress
volumes:
- www:/www:rw
volumes:
www:
driver: local
driver_opts:
o: bind
type: none
device: "${INCEPTION_WWW_PATH:?error}"
### services ###
# image:
# build:

View file

@ -26,8 +26,6 @@ RUN apk fix
# add config
RUN rm /etc/nginx/nginx.conf
COPY conf/ /etc/nginx/
RUN rm -r /usr/share/nginx/html
COPY www/ /usr/share/nginx/html
# start
CMD ["nginx", "-g", "daemon off;"]

View file

@ -35,12 +35,16 @@ http {
access_log /var/log/nginx/mcolonna.42.fr.access.log main;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
root /www;
index index.php;
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass wordpress:9000;
}
}
# TODO(more) error_page 404 /404.html;
# TODO(more) error_page 500 502 503 504 /50x.html;
}
}

View file

@ -0,0 +1,15 @@
# from https://exampleconfig.com/view/nginx-ubuntu20-04-etc-nginx-snippets-fastcgi-php-conf
# regex to split $uri to $fastcgi_script_name and $fastcgi_path
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
# Check that the PHP script exists before passing it
try_files $fastcgi_script_name =404;
# Bypass the fact that try_files resets $fastcgi_path_info
# see: http://trac.nginx.org/nginx/ticket/321
set $path_info $fastcgi_path_info;
fastcgi_param PATH_INFO $path_info;
fastcgi_index index.php;
include fastcgi.conf;

View file

@ -1,143 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>yippee</title>
<style>
* {
animation-play-state: paused;
}
@font-face
{
font-family: "Varela Round";
src: url("/VarelaRound.ttf");
}
html {
height: 100%;
}
body {
height: 100%;
margin: 0;
padding: 0;
background: #000000;
}
.yippee {
font-size: 3em;
font-family: "Varela Round";
font-weight: bold;
}
@keyframes rotationoeoeoe {
0% { transform: rotate(0); }
100% { transform: rotate(360deg); }
}
@keyframes pulseyayaya {
0% { transform: scale(1); }
50% { transform: scale(1.4); }
100% { transform: scale(1); }
}
@keyframes rainbow {
0% { color: #f00; }
17% { color: #f00; }
17% { color: #ff0; }
33% { color: #ff0; }
33% { color: #0f0; }
50% { color: #0f0; }
50% { color: #0ff; }
67% { color: #0ff; }
67% { color: #00f; }
83% { color: #00f; }
83% { color: #f0f; }
100% { color: #f0f; }
100% { color: #f00; }
}
.yippee {
animation-name: rotationoeoeoe;
animation-duration: 1s;
animation-timing-function: linear;
animation-iteration-count: infinite;
}
.yippee > .yippeeinner {
animation-name: pulseyayaya;
animation-duration: .8s;
animation-timing-function: ease-in-out;
animation-iteration-count: infinite;
}
#one, #two, #three {
width: 100%;
height: 100%;
position: absolute;
display: flex;
align-items: center;
justify-content: center;
animation-name: rainbow;
animation-duration: 1s;
animation-iteration-count: infinite;
}
#one {
z-index: 3;
color: #f00;
animation-delay: .0s;
}
#one > .yippee {
animation-delay: .0s;
}
#one > .yippee > .yippeeinner {
animation-delay: .0s;
}
#two {
z-index: 2;
color: #0f0;
opacity: .50;
animation-delay: .1s;
}
#two > .yippee {
animation-delay: .05s;
}
#two > .yippee > .yippeeinner {
animation-delay: .05s;
}
#three {
z-index: 1;
color: #00f;
opacity: .33;
animation-delay: .2s;
}
#three > .yippee {
animation-delay: .1s;
}
#three > .yippee > .yippeeinner {
animation-delay: .1s;
}
* {
animation-play-state: running;
}
</style>
</head>
<body>
<div id="one"><div class="yippee"><div class="yippeeinner">yippee</div></div></div>
<div id="two"><div class="yippee"><div class="yippeeinner">yippee</div></div></div>
<div id="three"><div class="yippee"><div class="yippeeinner">yippee</div></div></div>
</body>
</html>

View file

@ -0,0 +1,24 @@
# TODO(any)(latest)
FROM alpine:latest
# EXPOSE
EXPOSE 9000
# install packages
RUN apk update
RUN apk add php-fpm
RUN apk fix
RUN addgroup -S www
RUN adduser -D -S -G www www
#RUN apk add curl
# install wordpress
# RUN mkdir -p /www
# RUN curl https://wordpress.org/latest.tar.gz | tar zx -C /www
# add config
COPY /conf/ /etc/php83/
# start
CMD ["php-fpm83", "-F"]

View file

@ -0,0 +1 @@
include=/etc/php83/php-fpm.d/*.conf

View file

@ -0,0 +1,11 @@
[www]
user = www
group = www
listen = wordpress:9000
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3