diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..1b04ef8 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,7 @@ +Dockerfile +.dockerignore +node_modules +npm-debug.log +README.md +.next +.git \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..81b4102 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,57 @@ +# Install dependencies only when needed +FROM node:16-alpine AS deps +# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. +RUN apk add --no-cache libc6-compat +WORKDIR /app + +# Install dependencies based on the preferred package manager +COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./ +RUN \ + if [ -f yarn.lock ]; then yarn --frozen-lockfile; \ + elif [ -f package-lock.json ]; then npm ci; \ + elif [ -f pnpm-lock.yaml ]; then yarn global add pnpm && pnpm i --frozen-lockfile; \ + else echo "Lockfile not found." && exit 1; \ + fi + + +# Rebuild the source code only when needed +FROM node:16-alpine AS builder +WORKDIR /app +COPY --from=deps /app/node_modules ./node_modules +COPY . . + +# Next.js collects completely anonymous telemetry data about general usage. +# Learn more here: https://nextjs.org/telemetry +# Uncomment the following line in case you want to disable telemetry during the build. +# ENV NEXT_TELEMETRY_DISABLED 1 + +RUN yarn build + +# If using npm comment out above and use below instead +# RUN npm run build + +# Production image, copy all the files and run next +FROM node:16-alpine AS runner +WORKDIR /app + +ENV NODE_ENV production +# Uncomment the following line in case you want to disable telemetry during runtime. +# ENV NEXT_TELEMETRY_DISABLED 1 + +RUN addgroup --system --gid 1001 nodejs +RUN adduser --system --uid 1001 nextjs + +COPY --from=builder /app/public ./public + +# Automatically leverage output traces to reduce image size +# https://nextjs.org/docs/advanced-features/output-file-tracing +COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./ +COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static + +USER nextjs + +EXPOSE 3000 + +ENV PORT 3000 + +CMD ["node", "server.js"] \ No newline at end of file diff --git a/components/Credits.tsx b/components/Credits.tsx new file mode 100644 index 0000000..ed80085 --- /dev/null +++ b/components/Credits.tsx @@ -0,0 +1,15 @@ +import Link from "next/link" + + +const Credits = ({ credits }) => { + return ( + + {credits.name} + + ) +} + + + +export default Credits \ No newline at end of file diff --git a/components/Head.tsx b/components/Head.tsx new file mode 100644 index 0000000..003043d --- /dev/null +++ b/components/Head.tsx @@ -0,0 +1,48 @@ +import NextHead from "next/head" + +const Head = ({ redirect }: { redirect?: { url: string, site: string } }) => { + + return ( + + + + + + heika.dog + + {!redirect && ( + <> + + + )} + {redirect && ( + <> + + + )} + + + + + + + + + + + + + + {redirect && ( + <> + + + )} + + + ) +} + + + +export default Head \ No newline at end of file diff --git a/lib/constants.js b/lib/constants.js new file mode 100644 index 0000000..00c3c4c --- /dev/null +++ b/lib/constants.js @@ -0,0 +1,19 @@ +const consts = { + socials: { + spotify: "https://open.spotify.com/playlist/52m7Bk2Lo0qGvzdn9Ecyjx?si=cba9a3a596a746d6", + soundcloud: "https://soundcloud.com/heikadog", + twitter: "https://twitter.com/heikadog", + discord: "https://discordapp.com/users/319164759478108170", + bandcamp: "https://heikadog.bandcamp.com/", + twitch: "https://twitch.tv/heikadog", + mail: "mailto:email@heika.dog", + teespring: "https://club-siberian.creator-spring.com/" + }, + music: { + special: "https://heikadog.bandcamp.com/album/specialty-endeavors", + sleepydogs: "https://distrokid.com/hyperfollow/heikadog/songs-for-dogs-to-sleep-to-ambient-2" + } +} + +module.exports = consts +module.default = consts \ No newline at end of file diff --git a/lib/socialRewrites.js b/lib/socialRewrites.js new file mode 100644 index 0000000..301342f --- /dev/null +++ b/lib/socialRewrites.js @@ -0,0 +1,12 @@ +const c = require('./constants') + + +const SocialRewrites = Object.keys(c.socials) + .map(b => { + return { + source: `/${b}`, + destination: `/socials/${b}` + } + }) + +module.exports = SocialRewrites \ No newline at end of file diff --git a/next.config.js b/next.config.js new file mode 100644 index 0000000..c3ce18c --- /dev/null +++ b/next.config.js @@ -0,0 +1,16 @@ +// https://distrokid.com/hyperfollow/heikadog/songs-for-dogs-to-sleep-to-ambient-2module.exports = { +const SocialRewrites = require("./lib/socialRewrites.js") + +module.exports = { + // ... rest of the configuration. + output: 'standalone', + rewrites: async function () { + return [ + { + source: "/favicon.ico", + destination: "/assets/favicon.png" + }, + ...SocialRewrites + ] + } +} \ No newline at end of file diff --git a/pages/socials/[social].tsx b/pages/socials/[social].tsx new file mode 100644 index 0000000..ba96bf2 --- /dev/null +++ b/pages/socials/[social].tsx @@ -0,0 +1,36 @@ +import constants from "lib/constants"; +import Head from "components/Head"; +import styles from "../../styles/Index.module.sass"; + +const Social = (props) => { + return ( + <> + +
+

+ {props.site} +

+
+ + ); +}; + + +export async function getStaticPaths() { + let socials = Object.keys(constants.socials).map(a => `/socials/${a}`) + return { + paths: [...socials], + fallback: false + } +} + +export async function getStaticProps({ params }) { + return { + props: { + site: params.social, + url: constants.socials[params.social] + } + } +} + +export default Social; diff --git a/public/assets/Avatar.png b/public/assets/Avatar.png new file mode 100644 index 0000000..5621044 Binary files /dev/null and b/public/assets/Avatar.png differ diff --git a/public/assets/website_background.png b/public/assets/website_background.png new file mode 100644 index 0000000..7012f3b Binary files /dev/null and b/public/assets/website_background.png differ