This commit is contained in:
2026-01-25 21:03:44 -05:00
parent 4de78e982c
commit 8b3a0a9352
19 changed files with 287 additions and 248 deletions

27
.gitignore vendored
View File

@@ -3,3 +3,30 @@ config/
*.env
bin/
logs/
node_modules/
*lock.json
# Nuxt dev/build outputs
.output
.data
.nuxt
.nitro
.cache
dist
# Node dependencies
node_modules
# Logs
logs
*.log
# Misc
.DS_Store
.fleet
.idea
# Local env files
.env
.env.*
!.env.example

26
Dockerfile Normal file
View File

@@ -0,0 +1,26 @@
# Stage 1: Build the Nuxt application
FROM node:20-alpine AS builder
WORKDIR /app
COPY /app/package*.json ./
RUN npm install
COPY . .
RUN npm run build
FROM node:20-alpine AS runner
WORKDIR /app
COPY --from=builder /app/.output ./.output
COPY --from=builder /app/package*.json ./
COPY --from=builder /app/node_modules ./node_modules
# Ensure necessary environment variables are set if needed at runtime
# Nuxt uses NUXT_ prefix for runtime environment variables
EXPOSE 3030
ENV NUXT_PORT=3030
ENV PORT=3030
# Command to run the application
CMD ["node", "./.output/server/index.mjs"]

24
app/.gitignore vendored Normal file
View File

@@ -0,0 +1,24 @@
# Nuxt dev/build outputs
.output
.data
.nuxt
.nitro
.cache
dist
# Node dependencies
node_modules
# Logs
logs
*.log
# Misc
.DS_Store
.fleet
.idea
# Local env files
.env
.env.*
!.env.example

75
app/README.md Normal file
View File

@@ -0,0 +1,75 @@
# Nuxt Minimal Starter
Look at the [Nuxt documentation](https://nuxt.com/docs/getting-started/introduction) to learn more.
## Setup
Make sure to install dependencies:
```bash
# npm
npm install
# pnpm
pnpm install
# yarn
yarn install
# bun
bun install
```
## Development Server
Start the development server on `http://localhost:3000`:
```bash
# npm
npm run dev
# pnpm
pnpm dev
# yarn
yarn dev
# bun
bun run dev
```
## Production
Build the application for production:
```bash
# npm
npm run build
# pnpm
pnpm build
# yarn
yarn build
# bun
bun run build
```
Locally preview production build:
```bash
# npm
npm run preview
# pnpm
pnpm preview
# yarn
yarn preview
# bun
bun run preview
```
Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.

5
app/app.vue Normal file
View File

@@ -0,0 +1,5 @@
<template>
<NuxtLayout>
<NuxtPage />
</NuxtLayout>
</template>

Binary file not shown.

View File

Before

Width:  |  Height:  |  Size: 877 B

After

Width:  |  Height:  |  Size: 877 B

36
app/assets/main.css Normal file
View File

@@ -0,0 +1,36 @@
html, body, #__nuxt {
height: 100%;
margin: 0;
background: #0b0b0b;
overflow: hidden;
font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}
.caramel-wrapper {
position: fixed;
inset: 0;
display: grid;
place-items: center;
pointer-events: none;
}
.caramel-stage {
background-color: black;
padding: 25px;
border-radius: 10%;
filter:
drop-shadow(0 0 40px rgba(255, 255, 255, 0.6))
drop-shadow(0 0 80px rgba(255, 255, 255, 0.08));
}
.caramel-video {
width: min(90vw, 90vh);
height: auto;
max-height: 90vh;
image-rendering: pixelated;
}
body {
background: #0b0b0b;
}

23
app/nuxt.config.ts Normal file
View File

@@ -0,0 +1,23 @@
export default defineNuxtConfig({
devServer: {
host: "0.0.0.0", // Listen on all network interfaces
port: 3030, // Set your desired port
},
modules: [
'@nuxt/ui',
'@nuxt/image'
],
app: {
head: {
title: 'gimme.pet',
meta: [
{ name: 'description', content: 'professionally obnoxious.' }
]
}
},
css: ['~/assets/main.css']
})

21
app/package.json Normal file
View File

@@ -0,0 +1,21 @@
{
"name": "gimme-pet-root",
"type": "module",
"private": true,
"scripts": {
"build": "nuxt build",
"dev": "nuxt dev",
"generate": "nuxt generate",
"preview": "nuxt preview",
"postinstall": "nuxt prepare"
},
"dependencies": {
"@nuxt/image": "^2.0.0",
"@nuxt/ui": "^4.4.0",
"nuxt": "^4.3.0",
"tailwindcss": "^4.1.18",
"typescript": "^5.9.3",
"vue": "^3.5.27",
"vue-router": "^4.6.4"
}
}

20
app/pages/index.vue Normal file
View File

@@ -0,0 +1,20 @@
<template>
<div class="uwu-floating">
</div>
<div class="caramel-wrapper">
<div class="caramel-stage">
<video class="caramel-video" autoplay loop playsinline preload="auto">
<source src="~/assets/caramelldansen.webm" type="video/webm" />
quick turn on video
</video>
</div>
</div>
<div class="fixed bottom-4 right-6 opacity-40 text-xs select-none">
gimme.pet
</div>
</template>

BIN
app/public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

2
app/public/robots.txt Normal file
View File

@@ -0,0 +1,2 @@
User-Agent: *
Disallow:

18
app/tsconfig.json Normal file
View File

@@ -0,0 +1,18 @@
{
// https://nuxt.com/docs/guide/concepts/typescript
"files": [],
"references": [
{
"path": "./.nuxt/tsconfig.app.json"
},
{
"path": "./.nuxt/tsconfig.server.json"
},
{
"path": "./.nuxt/tsconfig.shared.json"
},
{
"path": "./.nuxt/tsconfig.node.json"
}
]
}

View File

@@ -1,142 +0,0 @@
#!/bin/bash
# This script is for building
# all stack variations and check for errors
# during the mysqli and pdo connect.
# This Script is build for Linux
# Info:
# This Script works on WSL2 _but_ you cant use
# WSL2 Windows Host mounted paths for the data.
dc=$(which docker-compose)
osversion=$(uname)
dbarr=(mariadb103 mariadb104 mariadb105 mariadb106 mysql57 mysql8)
checkdep() {
echo "### checking dependencies"
which docker || { echo 'Executable not found: docker' ; exit 1; }
which docker-compose || { echo 'Executable not found: docker-compose' ; exit 1; }
which curl || { echo 'Executable not found: curl' ; exit 1; }
which sed || { echo 'Executable not found: sed' ; exit 1; }
}
usage() {
echo "Usage:"
echo " -b = build all container variations of specified version"
echo " valid values are: php54, php56, php71, php72, php73, php74, php8, php81, php82, php83, php84"
echo -e " \nAttention: !!! SCRIPT REMOVES ALL DATA IN 'data/mysql/*' !!!"
}
# build stack variations
build () {
echo "### building $buildtarget-$version"
# removing old mysql data, old data prevents mysql
# from starting correct
echo -e "### cleaning old mysql data"
rm -rf ./data/mysql/*
echo -e "### building ./buildtarget/$buildtarget-$version.env \n"
$dc --env-file ./buildtest/$buildtarget-$version.env up -d --build --force-recreate
# wait for mysql to initialize
sleep 30
# check definitions
curlmysqli=$(curl -s --max-time 15 --connect-timeout 15 http://localhost/test_db.php |grep proper |wc -l |tr -d '[:space:]')
curlpdo=$(curl -s --max-time 15 --connect-timeout 15 http://localhost/test_db_pdo.php |grep proper |wc -l |tr -d '[:space:]')
# check if we can create a successfull connection to the database
# 1=OK everything else is not ok
if [ "$curlmysqli" -ne "1" ]; then
echo -e "### ERROR: myqli database check failed expected string 'proper' not found \n"
echo "### ...stopping container"
$dc --env-file ./buildtest/$buildtarget-$version.env down
exit
else
echo -e "\n OK - mysqli database check successfull \n"
sleep 3
fi
if [ "$curlpdo" -ne "1" ]; then
echo -e "### ERROR: pdo database check failed expected string 'proper' not found \n"
echo "### ...stopping container"
$dc --env-file ./buildtest/$buildtarget-$version.env down
exit
else
echo -e "\n OK - pdo database check successfull \n"
sleep 3
fi
echo "### ... stopping container"
$dc --env-file ./buildtest/$buildtarget-$version.env down
}
buildenvfile () {
cat sample.env > ./buildtest/"$buildtarget"-"$version".env
sed -i "s/COMPOSE_PROJECT_NAME=lamp/COMPOSE_PROJECT_NAME=$buildtarget-buildtest/" ./buildtest/"$buildtarget"-"$version".env
sed -i "s/PHPVERSION=php8/PHPVERSION=$buildtarget/" ./buildtest/"$buildtarget"-"$version".env
sed -i "s/DATABASE=mysql8/DATABASE=$version/" ./buildtest/"$buildtarget"-"$version".env
}
prepare () {
# generate all .env files for building
echo "### building env file"
mkdir -p ./buildtest
rm -rf ./buildtest/"$buildtarget"*
}
cleanup () {
echo "### cleaning old env file"
rm -rf ./buildtest/"$buildtarget"*
}
while getopts ":b:" opt;
do
case "${opt}" in
b) buildtarget=${OPTARG};;
esac
no_args="false"
done
# check user input
[[ "$no_args" == "true" ]] && { usage; exit 1; }
# check if we are running on Linux
if [[ $osversion != 'Linux' ]]; then
echo "This Script only supports Linux sorry :("
exit
fi
# we don't want to test against mysql8 for the old
# php versions due to pdo, therefore we only
# take the first 5 elements of the database versions arrays
if [ "$buildtarget" == 'php54' ]||[ "$buildtarget" == 'php56' ]||[ "$buildtarget" == 'php71' ]||\
[ "$buildtarget" == 'php72' ]||[ "$buildtarget" == 'php73' ] ; then
for version in "${dbarr[@]:0:5}"
do
checkdep
prepare
buildenvfile "$buildtarget" "$version"
build "$buildtarget" "$version"
cleanup
done
elif [ "$buildtarget" == 'php74' ]||[ "$buildtarget" == 'php8' ]||[ "$buildtarget" == 'php81' ] || [ "$buildtarget" == 'php82' ] || [ "$buildtarget" == 'php83' ] || [ "$buildtarget" == 'php84' ] ; then
for version in "${dbarr[@]}"
do
checkdep
prepare
buildenvfile "$buildtarget" "$version"
build "$buildtarget" "$version"
cleanup
done
else
echo "Input not valid"
usage
fi
exit

View File

@@ -1,74 +1,15 @@
version: "3"
version: '3.8'
services:
webserver:
nuxt-app:
# Builds the image using the local Dockerfile
build:
context: ./bin/${PHPVERSION}
container_name: "${COMPOSE_PROJECT_NAME}-${PHPVERSION}"
restart: "always"
context: .
dockerfile: Dockerfile
ports:
- "${HOST_MACHINE_UNSECURE_HOST_PORT}:80"
- "${HOST_MACHINE_SECURE_HOST_PORT}:443"
links:
- database
volumes:
- ${DOCUMENT_ROOT-./www}:/var/www/html:rw
- ${PHP_INI-./config/php/php.ini}:/usr/local/etc/php/php.ini
- ${SSL_DIR-./config/ssl}:/etc/apache2/ssl/
- ${VHOSTS_DIR-./config/vhosts}:/etc/apache2/sites-enabled
- ${LOG_DIR-./logs/apache2}:/var/log/apache2
- ${XDEBUG_LOG_DIR-./logs/xdebug}:/var/log/xdebug
- "3030:3030"
restart: unless-stopped
environment:
APACHE_DOCUMENT_ROOT: ${APACHE_DOCUMENT_ROOT-/var/www/html}
PMA_PORT: ${HOST_MACHINE_PMA_PORT}
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
HOST_MACHINE_MYSQL_PORT: ${HOST_MACHINE_MYSQL_PORT}
XDEBUG_CONFIG: "client_host=host.docker.internal remote_port=${XDEBUG_PORT}"
extra_hosts:
- "host.docker.internal:host-gateway"
database:
build:
context: "./bin/${DATABASE}"
container_name: "${COMPOSE_PROJECT_NAME}-${DATABASE}"
restart: "always"
ports:
- "127.0.0.1:${HOST_MACHINE_MYSQL_PORT}:3306"
volumes:
- ${MYSQL_INITDB_DIR-./config/initdb}:/docker-entrypoint-initdb.d
- ${MYSQL_DATA_DIR-./data/mysql}:/var/lib/mysql
- ${MYSQL_LOG_DIR-./logs/mysql}:/var/log/mysql
- ${MYSQL_CNF-./config/mysql/my.cnf}:/etc/my.cnf
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
phpmyadmin:
image: phpmyadmin
container_name: "${COMPOSE_PROJECT_NAME}-phpmyadmin"
links:
- database
environment:
PMA_HOST: database
PMA_PORT: 3306
PMA_USER: root
PMA_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
UPLOAD_LIMIT: ${UPLOAD_LIMIT}
MEMORY_LIMIT: ${MEMORY_LIMIT}
ports:
- "${HOST_MACHINE_PMA_PORT}:80"
- "${HOST_MACHINE_PMA_SECURE_PORT}:443"
volumes:
- /sessions
- ${PHP_INI-./config/php/php.ini}:/usr/local/etc/php/conf.d/php-phpmyadmin.ini
redis:
container_name: "${COMPOSE_PROJECT_NAME}-redis"
image: redis:latest
ports:
- "127.0.0.1:${HOST_MACHINE_REDIS_PORT}:6379"
- PORT=3030
- NUXT_PORT=3030
- HOST=0.0.0.0

View File

@@ -1,37 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>GIMME PET</title>
<link rel="shortcut icon" href="/assets/images/favicon.svg" type="image/svg+xml">
<link rel="stylesheet" href="/assets/css/bulma.min.css">
</head>
<body>
<section class="hero is-medium is-info is-bold">
<div class="hero-body">
<div class="container has-text-centered">
<h1 class="title">
:O
</h1>
<h2 class="subtitle">
NEVER EXPECT ANYTHING
</h2>
</div>
</div>
</section>
<section class="section">
<div class="container">
<div class="columns">
</div>
</div>
</section>
<footer class="footer">
<div class="content has-text-centered">
<p>
</p>
</div>
</footer>
</body>
</html>