1
0

」 feat: Added static website

This commit is contained in:
2025-02-22 17:11:06 +01:00
parent 05d2f7a981
commit 1004dba659
11 changed files with 120 additions and 3 deletions

View File

@ -3,11 +3,15 @@ name: inception
volumes:
wp-db:
wp-site:
nginx-certs:
networks:
inception:
external: false
include:
- docker/bonus/compose.yml
services:
nginx:
container_name: inception-nginx
@ -30,6 +34,7 @@ services:
- wp-site:/var/www/wordpress
- ./configs/nginx/templates:/etc/nginx/templates
- ./configs/nginx/entry:/docker-entrypoint.d
- nginx-certs:/etc/nginx/ssl
ports:
- "8443:8443"
restart: unless-stopped

View File

@ -0,0 +1,11 @@
services:
static-site:
build: static-site
ports:
- 8080:443
depends_on:
- nginx
environment:
- TZ=Europe/Paris
- NGINX_SSL_KEY_FILE=/etc/nginx/ssl/kanel-wp.key
- NGINX_SSL_CERT_FILE=/etc/nginx/ssl/kanel-wp.crt

View File

@ -0,0 +1,8 @@
FROM inception-nginx
LABEL maintainer="KeyZox"
COPY kanelovh/ /var/www/html/
COPY --chmod=644 www.conf.template /etc/nginx/templates/www.conf.template
COPY --chmod=644 cert.sh /docker-entrypoint.d/

View File

@ -0,0 +1,9 @@
#!/bin/sh
if [ ! -f ${NGINX_SSL_KEY_FILE} ]; then
echo "Generating certs"
mkdir -p /etc/nginx/ssl
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout ${NGINX_SSL_KEY_FILE} -out ${NGINX_SSL_CERT_FILE} -subj "/C=FR/ST=IDF/L=Angouleme/O=42/OU=42/CN=kanel.ovh/UID=adjoly"
else
printf "Key already exist not recreating\n"
fi

View File

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Kanel Supremacy</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="image-container">
<img id="kanel" src="#">
</div>
<script type="text/javascript" src="script.js"></script>
</body>
</html>

View File

@ -0,0 +1,24 @@
function init()
{
var img = document.querySelector("#kanel");
const random = Math.floor(Math.random() * 70) + 1;
img.src = 'https://kanel.ovh/img/'+random+'.jpg';
const { naturalWidth, naturalHeight } = img;
const isLandscape = naturalWidth / naturalHeight > 1;
if (isLandscape) {
img.style.width = window.innerWidth+'px';
img.style.height = 'auto';
} else {
img.style.height = window.innerHeight+'px';
img.style.width = 'auto';
}
if (img.src == 'https://kanel.ovh/img/70.jpg')
{
img.style.height = 'auto';
img.style.width = '100%';
}
}
init();

View File

@ -0,0 +1,28 @@
body, html
{
margin: 0;
padding: 0;
display: flex;
align-items: center;
justify-content: center;
background-color: #f0f0f0;
overflow: hidden;
box-sizing: border-box;
}
.image-container
{
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
position: relative;
}
.img
{
width: 100%;
height: auto;
}

View File

@ -0,0 +1,17 @@
server {
listen 0.0.0.0:443 ssl;
root /var/www/html;
index index.html;
ssl_certificate $NGINX_SSL_CERT_FILE;
ssl_certificate_key $NGINX_SSL_KEY_FILE;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_session_timeout 10m;
keepalive_timeout 60;
location / {
try_files $${q}uri $${q}uri/ =404;
}
}

View File

@ -39,4 +39,4 @@ WORKDIR /var/lib/mysql
EXPOSE 3306
CMD [ "mariadbd", "--user=mysql" ]
HEALTHCHECK --interval=30s --timeout=10s --retries=3 --start-period=1s --start-interval=2s CMD /docker-healthcheck
HEALTHCHECK --interval=30s --timeout=10s --retries=3 --start-period=3s --start-interval=2s CMD /docker-healthcheck

View File

@ -37,4 +37,4 @@ STOPSIGNAL SIGQUIT
EXPOSE 80
CMD [ "nginx", "-g", "daemon off;" ]
HEALTHCHECK --interval=30s --timeout=10s --retries=3 --start-period=1s --start-interval=2s CMD curl http://127.0.0.1:80/health || exit 1
HEALTHCHECK --interval=30s --timeout=10s --retries=3 --start-period=3s --start-interval=2s CMD curl http://127.0.0.1:80/health || exit 1

View File

@ -58,4 +58,4 @@ STOPSIGNAL SIGQUIT
EXPOSE 9000
CMD [ "php-fpm84", "-F" ]
HEALTHCHECK --interval=30s --timeout=10s --retries=3 --start-period=1s --start-interval=2s CMD cgi-fcgi -bind -connect 127.0.0.1:${PHP_PORT:-9000} || exit 1
HEALTHCHECK --interval=30s --timeout=10s --retries=3 --start-period=3s --start-interval=2s CMD cgi-fcgi -bind -connect 127.0.0.1:${PHP_PORT:-9000} || exit 1