initial commit

This commit is contained in:
Fabio Sinibaldi 2025-03-04 14:59:43 +01:00
parent ce9582f7ca
commit dc49829d19
9 changed files with 242 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.DS_Store

View File

@ -0,0 +1,34 @@
version: "3.8"
#Imported from https://github.com/nextcloud/all-in-one/discussions/575#discussion-4055615
services:
caddy:
image: caddy:alpine
restart: unless-stopped
container_name: caddy
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- ./certs:/certs
- ./config:/config
- ./data:/data
- ./sites:/srv
network_mode: "host"
nextcloud:
image: nextcloud/all-in-one:latest
restart: unless-stopped
container_name: nextcloud-aio-mastercontainer
ports:
- "8080:8080"
environment:
- APACHE_PORT=11000
volumes:
- nextcloud_aio_mastercontainer:/mnt/docker-aio-config
- /var/run/docker.sock:/var/run/docker.sock:ro
depends_on:
- caddy
volumes:
nextcloud_aio_mastercontainer:
name: nextcloud_aio_mastercontainer

View File

@ -0,0 +1,16 @@
#! /usr/bin/bash
echo "Installing denpendency packages..."
docker run \
--init \
--sig-proxy=false \
--name nextcloud-aio-mastercontainer \
--restart always \
--publish 8080:8080 \
--env APACHE_PORT=11000 \
--env APACHE_IP_BINDING=0.0.0.0 \
--env APACHE_ADDITIONAL_NETWORK="" \
--env SKIP_DOMAIN_VALIDATION=false \
--volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \
--volume /var/run/docker.sock:/var/run/docker.sock:ro \
nextcloud/all-in-one:latest

View File

@ -0,0 +1,14 @@
FROM node:14
WORKDIR /app
COPY server.js .
COPY index.html .
#COPY images ./images
COPY package.json .
RUN npm install
EXPOSE 3000
CMD ["node","server.js"]

View File

@ -0,0 +1,4 @@
Simple Site
===========
Simple dockerized application using Node.js behind NGINX in order to securely serve a static webapp

View File

@ -0,0 +1,25 @@
version: '3'
services:
# 3 versions of the same app responding to host's 3001-3
app1:
build: .
environment:
- APP_NAME=App1
ports:
- "3001:3000"
app2:
build: .
environment:
- APP_NAME=App2
ports:
- "3002:3000"
app3:
build: .
environment:
- APP_NAME=App3
ports:
- "3003:3000"

View File

@ -0,0 +1,114 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Beautiful Landing Page</title>
<style>
body {
font-family: Arial, sans-serif;
line-height: 1.6;
margin: 0;
padding: 0;
background-color: #f0f0f0;
color: #333;
}
header {
background: url('images/career-quiz.png') no-repeat center center/cover;
color: #fff;
padding: 100px 0;
height: 150px;
text-align: center;
}
header h1 {
font-size: 3em;
margin: 0;
}
header p {
font-size: 1.2em;
}
nav {
background: #333;
color: #fff;
display: flex;
justify-content: space-around;
padding: 15px 0;
}
nav a {
color: #fff;
text-decoration: none;
font-weight: bold;
}
.container {
padding: 20px;
}
.grid {
display: flex;
gap: 20px;
flex-wrap: wrap;
}
.card {
background: #fff;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
flex: 1;
min-width: 280px;
max-width: 300px;
padding: 15px;
}
.card img {
border-radius: 8px;
width: 100%;
height: auto;
}
footer {
background: #333;
color: #fff;
text-align: center;
padding: 20px 0;
margin-top: 20px;
}
</style>
</head>
<body>
<header>
</header>
<nav>
<a href="#home">Home</a>
<a href="#about">Best Courses</a>
<a href="#services">Fun Tutorials</a>
<a href="#contact">About TechWorld with Nana</a>
</nav>
<div class="container">
<h2>TechWorld with Nana Programs</h2>
<div class="grid">
<div class="card">
<img src="images/devops.png?crop=entropy&fit=crop&w=400&h=200" alt="Service 1">
<h3>DevOps Bootcamp</h3>
<p>Finally learn with structured guided course, all DevOps tools together</p>
</div>
<div class="card">
<img src="images/it-beginners.png?crop=entropy&fit=crop&w=400&h=200" alt="Service 2">
<h3>Software Development LifeCycle Course</h3>
<p>Learn the entire software Development lifecycle, from developing, to testing, to provisioning server and deploying</p>
</div>
<div class="card">
<img src="images/devsecops.png?crop=entropy&fit=crop&w=400&h=200" alt="Service 3">
<h3>DevSecOps Bootcamp</h3>
<p>If you wanna become a DevOps engineer on steroids, you can face this advanced bootcamp</p>
</div>
</div>
</div>
<footer>
<p>&copy; TechWorld with Nana. All Rights Reserved.</p>
<p>Follow us on:
<a href="#" style="color: #3b5998;">Linkedin</a> |
<a href="#" style="color: #00aced;">Twitter</a> |
<a href="#" style="color: #e4405f;">Instagram</a>
</p>
</footer>
</body>
</html>

View File

@ -0,0 +1,16 @@
{
"name": "simple_site",
"version": "1.0.0",
"description": "A Node.js application serving a static HTML file, used for load balancing with NGINX.",
"main": "server.js",
"scripts": {
"start": "node server.js"
},
"author": "Fabio Sinibaldi",
"license": "MIT",
"dependencies": {
"express": "^4.17.1",
"path": "^0.12.7"
}
}

View File

@ -0,0 +1,18 @@
const express = require('express');
const path = require('path');
const app = express();
const port = 3000;
// Defined in compose file
const appName = process.env.APP_NAME
app.use('/images', express.static(path.join(__dirname, 'images')));
app.use('/', (req, res) => {
res.sendFile(path.join(__dirname, 'index.html'));
console.log(`Request served by ${appName}`);
});
app.listen(port, () => {
console.log(`${appName} is listening on port ${port}`);
});