-
Notifications
You must be signed in to change notification settings - Fork 712
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #133 from UNICKCHENG/feat/docker
feat: add docker support
- Loading branch information
Showing
10 changed files
with
222 additions
and
80 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,48 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
/coverage | ||
|
||
# next.js | ||
/.next/ | ||
/out/ | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
*.pem | ||
|
||
# debug | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
.pnpm-debug.log* | ||
|
||
# local env files | ||
.env*.local | ||
# .env | ||
.idea/ | ||
|
||
# vercel | ||
.vercel | ||
|
||
# typescript | ||
*.tsbuildinfo | ||
next-env.d.ts | ||
|
||
# Sentry | ||
.sentryclirc | ||
|
||
# Sentry | ||
next.config.original.js | ||
|
||
# lockfile | ||
pnpm-lock.yaml | ||
yarn.lock |
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 |
---|---|---|
@@ -1,15 +1,34 @@ | ||
# https://platform.openai.com/account/api-keys | ||
OPENAI_API_KEY=sk-xxx | ||
|
||
# https://www.bilibili.com | ||
BILIBILI_SESSION_TOKEN= | ||
|
||
# https://savesubs.com | ||
SAVESUBS_X_AUTH_TOKEN= | ||
|
||
# https://upstash.com | ||
UPSTASH_REDIS_REST_URL= | ||
UPSTASH_REDIS_REST_TOKEN= | ||
UPSTASH_RATE_REDIS_REST_URL= | ||
UPSTASH_RATE_REDIS_REST_TOKEN= | ||
LEMON_API_KEY= | ||
UPSTASH_RATE_REDIS_REST_URL=${UPSTASH_REDIS_REST_URL} | ||
UPSTASH_RATE_REDIS_REST_TOKEN=${UPSTASH_REDIS_REST_TOKEN} | ||
|
||
# https://supabase.com/docs/reference/javascript/initializing | ||
SUPABASE_HOSTNAME=xxxx.supabase.co | ||
NEXT_PUBLIC_SUPABASE_URL=https://${SUPABASE_HOSTNAME} | ||
NEXT_PUBLIC_SUPABASE_ANON_KEY= | ||
NEXT_PUBLIC_SUPABASE_URL=https://${SUPABASE_HOSTNAME} | ||
|
||
|
||
############ Optional ################# | ||
|
||
# https://docs.sentry.io/product/cli/configuration | ||
SENTRY_AUTH_TOKEN= | ||
|
||
# https://www.lemonsqueezy.com | ||
LEMON_API_KEY= | ||
|
||
# https://segment.com | ||
NEXT_PUBLIC_SEGMENT_WRITEKEY= | ||
|
||
NEXT_PUBLIC_SITE_URL= | ||
INTERNAL_API_HOSTNAME=api.example.com |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: "Relano - Automated Whats new videos" | ||
name: 'Relano - Automated Whats new videos' | ||
on: | ||
release: | ||
types: [published, edited] | ||
|
@@ -16,7 +16,7 @@ jobs: | |
with: | ||
node-version: 16 | ||
- name: Run relano | ||
uses: "Just-Moh-it/[email protected]" | ||
uses: 'Just-Moh-it/[email protected]' | ||
with: | ||
openai-api-key: ${{ secrets.OPENAI_API_KEY }} | ||
releaseNotes: ${{ github.event.release.body }} | ||
|
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
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,46 @@ | ||
# Hi, here is a Docker build file for your convenience in building a private Docker image. | ||
# Please make sure to configure the .env file in this project's root directory before proceeding. | ||
# It is important to note that this Docker image will include your .env file, so do not publicly share your Docker image. | ||
|
||
# Please follow the steps below: | ||
# 1. Install Docker | ||
# 2. Configure .env file | ||
# 3. Build Docker image | ||
|
||
# > Step 1 build NextJs | ||
FROM node:alpine AS builder | ||
WORKDIR /app | ||
COPY . . | ||
|
||
# removing sentry. If you want to use sentry, please set IS_USED_SENTRY=1 | ||
ARG IS_USED_SENTRY=0 | ||
RUN if [[ $IS_USED_SENTRY -eq 0 ]]; then \ | ||
sed -i 's/const { withSentryConfig }/\/\/ const { withSentryConfig }/' ./next.config.js &&\ | ||
sed -i 's/module.exports = withSentryConfig/\/\/ module.exports = withSentryConfig/' ./next.config.js \ | ||
; fi | ||
# building Nextjs | ||
RUN npm ci && npm run build | ||
|
||
|
||
# > Step 2 Build docker image | ||
FROM node:alpine AS runner | ||
WORKDIR /app | ||
|
||
ENV NODE_ENV production | ||
ENV PORT 3000 | ||
|
||
RUN addgroup -g 1001 -S nodejs &&\ | ||
adduser -S nextjs -u 1001 | ||
|
||
COPY --from=builder /app/.env ./.env | ||
COPY --from=builder /app/next.config.js ./ | ||
COPY --from=builder /app/public ./public | ||
COPY --from=builder --chown=nextjs:nodejs /app/.next ./.next | ||
COPY --from=builder /app/node_modules ./node_modules | ||
COPY --from=builder /app/package.json ./package.json | ||
COPY --from=builder /app/README.md ./README.md | ||
COPY --from=builder /app/LICENSE.txt ./LICENSE.txt | ||
|
||
USER nextjs | ||
EXPOSE 3000 | ||
CMD ["node_modules/.bin/next", "start"] |
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
Oops, something went wrong.