diff --git a/.gitignore b/.gitignore index bbb6c07..868f1e2 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b306a1a --- /dev/null +++ b/Dockerfile @@ -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"] \ No newline at end of file diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 0000000..4a7f73a --- /dev/null +++ b/app/.gitignore @@ -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 diff --git a/app/README.md b/app/README.md new file mode 100644 index 0000000..25b5821 --- /dev/null +++ b/app/README.md @@ -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. diff --git a/app/app.vue b/app/app.vue new file mode 100644 index 0000000..91fe27f --- /dev/null +++ b/app/app.vue @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/app/assets/caramelldansen.webm b/app/assets/caramelldansen.webm new file mode 100644 index 0000000..762921c Binary files /dev/null and b/app/assets/caramelldansen.webm differ diff --git a/www/assets/css/bulma.css.map b/app/assets/css/bulma.css.map similarity index 100% rename from www/assets/css/bulma.css.map rename to app/assets/css/bulma.css.map diff --git a/www/assets/css/bulma.min.css b/app/assets/css/bulma.min.css similarity index 100% rename from www/assets/css/bulma.min.css rename to app/assets/css/bulma.min.css diff --git a/www/assets/images/favicon.svg b/app/assets/images/favicon.svg similarity index 100% rename from www/assets/images/favicon.svg rename to app/assets/images/favicon.svg diff --git a/app/assets/main.css b/app/assets/main.css new file mode 100644 index 0000000..fa8c9c5 --- /dev/null +++ b/app/assets/main.css @@ -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; +} \ No newline at end of file diff --git a/app/nuxt.config.ts b/app/nuxt.config.ts new file mode 100644 index 0000000..df2e978 --- /dev/null +++ b/app/nuxt.config.ts @@ -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'] +}) \ No newline at end of file diff --git a/app/package.json b/app/package.json new file mode 100644 index 0000000..0a37572 --- /dev/null +++ b/app/package.json @@ -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" + } +} diff --git a/app/pages/index.vue b/app/pages/index.vue new file mode 100644 index 0000000..7821c6f --- /dev/null +++ b/app/pages/index.vue @@ -0,0 +1,20 @@ + \ No newline at end of file diff --git a/app/public/favicon.ico b/app/public/favicon.ico new file mode 100644 index 0000000..18993ad Binary files /dev/null and b/app/public/favicon.ico differ diff --git a/app/public/robots.txt b/app/public/robots.txt new file mode 100644 index 0000000..0ad279c --- /dev/null +++ b/app/public/robots.txt @@ -0,0 +1,2 @@ +User-Agent: * +Disallow: diff --git a/app/tsconfig.json b/app/tsconfig.json new file mode 100644 index 0000000..307b213 --- /dev/null +++ b/app/tsconfig.json @@ -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" + } + ] +} diff --git a/dev_build_container.sh b/dev_build_container.sh deleted file mode 100644 index afe2fdf..0000000 --- a/dev_build_container.sh +++ /dev/null @@ -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 diff --git a/docker-compose.yml b/docker-compose.yml index ce29d0f..019436e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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 \ No newline at end of file diff --git a/www/index.php b/www/index.php deleted file mode 100644 index 8f7795d..0000000 --- a/www/index.php +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - GIMME PET - - - - -
-
-
-

- :O -

-

- NEVER EXPECT ANYTHING -

-
-
-
-
-
-
- -
-
-
- - -