more changes
This commit is contained in:
parent
19157d2e09
commit
1fe1bef1a9
10 changed files with 210 additions and 0 deletions
7
.dockerignore
Normal file
7
.dockerignore
Normal file
|
@ -0,0 +1,7 @@
|
|||
Dockerfile
|
||||
.dockerignore
|
||||
node_modules
|
||||
npm-debug.log
|
||||
README.md
|
||||
.next
|
||||
.git
|
57
Dockerfile
Normal file
57
Dockerfile
Normal file
|
@ -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"]
|
15
components/Credits.tsx
Normal file
15
components/Credits.tsx
Normal file
|
@ -0,0 +1,15 @@
|
|||
import Link from "next/link"
|
||||
|
||||
|
||||
const Credits = ({ credits }) => {
|
||||
return (
|
||||
<Link
|
||||
href={`https://${credits.url}`}>
|
||||
<a>{credits.name}</a>
|
||||
</Link>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
|
||||
export default Credits
|
48
components/Head.tsx
Normal file
48
components/Head.tsx
Normal file
|
@ -0,0 +1,48 @@
|
|||
import NextHead from "next/head"
|
||||
|
||||
const Head = ({ redirect }: { redirect?: { url: string, site: string } }) => {
|
||||
|
||||
return (
|
||||
<NextHead>
|
||||
<link rel="icon" type="image/png" href="/assets/favicon.png" sizes="32x32" />
|
||||
<link rel="icon" type="image/png" href="/assets/favicon.png" sizes="96x96" />
|
||||
<link rel="icon" type="image/png" href="/assets/favicon.png" sizes="16x16" />
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/assets/favicon.png" />
|
||||
<title>heika.dog</title>
|
||||
<meta name="theme-color" content="#FABD02 " />
|
||||
{!redirect && (
|
||||
<>
|
||||
<meta property="og:title" content="heika.dog" />
|
||||
</>
|
||||
)}
|
||||
{redirect && (
|
||||
<>
|
||||
<meta property="og:title" content={` heika.dog on ${redirect.site}`} />
|
||||
</>
|
||||
)}
|
||||
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:url" content="https://heika.dog" />
|
||||
<meta property="og:description" content="heikadog and heikadog accessories" />
|
||||
<meta property="og:image" content="/assets/favicon.png" />
|
||||
|
||||
<meta name="description" content="your one-stop shop for all things sor." />
|
||||
<meta name="keywords" content="heikadog, heika, music, producer, furry" />
|
||||
|
||||
<meta name="twitter:card" content="summary" />
|
||||
<meta name="twitter:image" content="https://heika.dog/assets/favicon.png" />
|
||||
<meta name="twitter:creator" content="@hkadogs" />
|
||||
|
||||
{redirect && (
|
||||
<>
|
||||
<meta http-equiv="refresh" content={`2; url = ${redirect.url}`} />
|
||||
</>
|
||||
)}
|
||||
|
||||
</NextHead>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
|
||||
export default Head
|
19
lib/constants.js
Normal file
19
lib/constants.js
Normal file
|
@ -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
|
12
lib/socialRewrites.js
Normal file
12
lib/socialRewrites.js
Normal file
|
@ -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
|
16
next.config.js
Normal file
16
next.config.js
Normal file
|
@ -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
|
||||
]
|
||||
}
|
||||
}
|
36
pages/socials/[social].tsx
Normal file
36
pages/socials/[social].tsx
Normal file
|
@ -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 (
|
||||
<>
|
||||
<Head redirect={props} />
|
||||
<div className={styles.center}>
|
||||
<p className={styles.name}>
|
||||
{props.site}
|
||||
</p>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
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;
|
BIN
public/assets/Avatar.png
Normal file
BIN
public/assets/Avatar.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 238 KiB |
BIN
public/assets/website_background.png
Normal file
BIN
public/assets/website_background.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 MiB |
Loading…
Add table
Reference in a new issue