-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f98cb88
commit 9b7eea5
Showing
5 changed files
with
125 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Dockerfile | ||
.dockerignore | ||
node_modules | ||
npm-debug.log | ||
README.md | ||
.next | ||
!.next/static | ||
!.next/standalone | ||
.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*.*.*" | ||
- "v*.*.*-hotfix.*" | ||
- "v*.*.*-nightly" | ||
- "v*.*.*-alpha" | ||
- "v*.*.*-beta" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
packages: write | ||
contents: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set ghcr.io url | ||
run: echo "REPO=${GITHUB_REPOSITORY@L}" >> "${GITHUB_ENV}" | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ghcr.io/${{ env.REPO }} | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GHCR_PAT }} | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v6 | ||
with: | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
|
||
- name: Release | ||
uses: softprops/action-gh-release@v2 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
FROM node:18-alpine AS base | ||
|
||
FROM base AS deps | ||
RUN apk add --no-cache libc6-compat | ||
WORKDIR /app | ||
|
||
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 corepack enable pnpm && pnpm i --frozen-lockfile; \ | ||
else echo "Lockfile not found." && exit 1; \ | ||
fi | ||
|
||
|
||
FROM base AS builder | ||
WORKDIR /app | ||
COPY --from=deps /app/node_modules ./node_modules | ||
COPY . . | ||
|
||
RUN \ | ||
if [ -f yarn.lock ]; then yarn run build; \ | ||
elif [ -f package-lock.json ]; then npm run build; \ | ||
elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm run build; \ | ||
else echo "Lockfile not found." && exit 1; \ | ||
fi | ||
|
||
FROM base AS runner | ||
WORKDIR /app | ||
|
||
ENV NODE_ENV=production | ||
|
||
RUN addgroup --system --gid 1001 nodejs | ||
RUN adduser --system --uid 1001 nextjs | ||
|
||
COPY --from=builder /app/public ./public | ||
|
||
RUN mkdir .next | ||
RUN chown nextjs:nodejs .next | ||
|
||
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 | ||
ENV HOSTNAME="0.0.0.0" | ||
|
||
CMD ["node", "server.js"] | ||
|
||
LABEL org.opencontainers.image.source https://github.com/ParzivalEugene/Links |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: "links" | ||
|
||
services: | ||
links: | ||
image: "links" | ||
build: . | ||
ports: | ||
- "3000:3000" | ||
environment: | ||
- SPOTIFY_CLIENT_ID=${SPOTIFY_CLIENT_ID} | ||
- SPOTIFY_CLIENT_SECRET=${SPOTIFY_CLIENT_SECRET} | ||
- GITHUB_TOKEN=${GITHUB_TOKEN} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ const nextConfig = { | |
}, | ||
], | ||
}, | ||
output: "standalone", | ||
}; | ||
|
||
export default nextConfig; |