「✨」 feat: Added static website
This commit is contained in:
@ -3,11 +3,15 @@ name: inception
|
|||||||
volumes:
|
volumes:
|
||||||
wp-db:
|
wp-db:
|
||||||
wp-site:
|
wp-site:
|
||||||
|
nginx-certs:
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
inception:
|
inception:
|
||||||
external: false
|
external: false
|
||||||
|
|
||||||
|
include:
|
||||||
|
- docker/bonus/compose.yml
|
||||||
|
|
||||||
services:
|
services:
|
||||||
nginx:
|
nginx:
|
||||||
container_name: inception-nginx
|
container_name: inception-nginx
|
||||||
@ -30,6 +34,7 @@ services:
|
|||||||
- wp-site:/var/www/wordpress
|
- wp-site:/var/www/wordpress
|
||||||
- ./configs/nginx/templates:/etc/nginx/templates
|
- ./configs/nginx/templates:/etc/nginx/templates
|
||||||
- ./configs/nginx/entry:/docker-entrypoint.d
|
- ./configs/nginx/entry:/docker-entrypoint.d
|
||||||
|
- nginx-certs:/etc/nginx/ssl
|
||||||
ports:
|
ports:
|
||||||
- "8443:8443"
|
- "8443:8443"
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
11
srcs/docker/bonus/compose.yml
Normal file
11
srcs/docker/bonus/compose.yml
Normal 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
|
8
srcs/docker/bonus/static-site/Dockerfile
Normal file
8
srcs/docker/bonus/static-site/Dockerfile
Normal 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/
|
9
srcs/docker/bonus/static-site/cert.sh
Normal file
9
srcs/docker/bonus/static-site/cert.sh
Normal 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
|
15
srcs/docker/bonus/static-site/kanelovh/index.html
Normal file
15
srcs/docker/bonus/static-site/kanelovh/index.html
Normal 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>
|
24
srcs/docker/bonus/static-site/kanelovh/script.js
Normal file
24
srcs/docker/bonus/static-site/kanelovh/script.js
Normal 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();
|
28
srcs/docker/bonus/static-site/kanelovh/style.css
Normal file
28
srcs/docker/bonus/static-site/kanelovh/style.css
Normal 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;
|
||||||
|
}
|
17
srcs/docker/bonus/static-site/www.conf.template
Normal file
17
srcs/docker/bonus/static-site/www.conf.template
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
@ -39,4 +39,4 @@ WORKDIR /var/lib/mysql
|
|||||||
|
|
||||||
EXPOSE 3306
|
EXPOSE 3306
|
||||||
CMD [ "mariadbd", "--user=mysql" ]
|
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
|
||||||
|
@ -37,4 +37,4 @@ STOPSIGNAL SIGQUIT
|
|||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
CMD [ "nginx", "-g", "daemon off;" ]
|
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
|
||||||
|
@ -58,4 +58,4 @@ STOPSIGNAL SIGQUIT
|
|||||||
|
|
||||||
EXPOSE 9000
|
EXPOSE 9000
|
||||||
CMD [ "php-fpm84", "-F" ]
|
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
|
||||||
|
Reference in New Issue
Block a user