-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: buiild add docker env variables fix: build chore: package lock chore: package lock chore: package lock chore: package lock chore: package lock chore: package lock chore: package lock chore: package lock chore: package lock chore: package lock chore: package lock chore: package lock chore: package lock chore: package lock chore: package lock chore: package lock chore: package lock chore: package lock chore: package lock chore: package lock chore: package lock chore: package lock chore: package lock ci(docker): fix docker build
- Loading branch information
Showing
13 changed files
with
107 additions
and
15 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,7 @@ | ||
Dockerfile | ||
.dockerignore | ||
node_modules | ||
npm-debug.log | ||
README.md | ||
.next | ||
.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,25 @@ | ||
name: Deploy | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: '18.18' | ||
- uses: oven-sh/setup-bun@v1 | ||
with: | ||
bun-version: latest | ||
- name: Install caprover | ||
run: sudo npm install -g caprover | ||
|
||
- name: Create tar | ||
run: tar -cvf ./deploy.tar --exclude='node_modules' --exclude='.git' --exclude='.next' * | ||
|
||
- name: Deploy | ||
run: caprover deploy -h ${{ secrets.CAPROVER_SERVER_PROD }} -p ${{ secrets.CAPROVER_PASSWORD_PROD }} -a riftmaker -t ./deploy.tar |
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 |
---|---|---|
|
@@ -36,4 +36,5 @@ yarn-error.log* | |
next-env.d.ts | ||
|
||
|
||
.env | ||
.env | ||
deploy.tar |
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,42 @@ | ||
FROM oven/bun:latest | ||
WORKDIR /usr/src/app | ||
|
||
ARG THRESHOLD=${THRESHOLD} | ||
ENV THRESHOLD=${THRESHOLD} | ||
ARG NEXTAUTH_SECRET=${NEXTAUTH_SECRET} | ||
ENV NEXTAUTH_SECRET=${NEXTAUTH_SECRET} | ||
ARG NEXTAUTH_URL=${NEXTAUTH_URL} | ||
ENV NEXTAUTH_URL=${NEXTAUTH_URL} | ||
ARG DISCORD_CLIENT_ID=${DISCORD_CLIENT_ID} | ||
ENV DISCORD_CLIENT_ID=${DISCORD_CLIENT_ID} | ||
ARG DISCORD_CLIENT_SECRET=${DISCORD_CLIENT_SECRET} | ||
ENV DISCORD_CLIENT_SECRET=${DISCORD_CLIENT_SECRET} | ||
ARG TWITCH_CLIENT_ID=${TWITCH_CLIENT_ID} | ||
ENV TWITCH_CLIENT_ID=${TWITCH_CLIENT_ID} | ||
ARG TWITCH_CLIENT_SECRET=${TWITCH_CLIENT_SECRET} | ||
ENV TWITCH_CLIENT_SECRET=${TWITCH_CLIENT_SECRET} | ||
ARG DATABASE_URL=${DATABASE_URL} | ||
ENV DATABASE_URL=${DATABASE_URL} | ||
ARG NEXT_PUBLIC_BASE_URL=${NEXT_PUBLIC_BASE_URL} | ||
ENV NEXT_PUBLIC_BASE_URL=${NEXT_PUBLIC_BASE_URL} | ||
|
||
# Install nodejs using n | ||
RUN apt-get -y update; apt-get -y install curl | ||
ARG NODE_VERSION=18 | ||
RUN curl -L https://raw.githubusercontent.com/tj/n/master/bin/n -o n \ | ||
&& bash n $NODE_VERSION \ | ||
&& rm n \ | ||
&& npm install -g n | ||
|
||
COPY bun.lockb package.json prisma ./ | ||
RUN bun install | ||
|
||
COPY . . | ||
RUN bunx prisma generate | ||
|
||
RUN bun run build | ||
ENV NODE_ENV production | ||
|
||
WORKDIR /usr/src/app/.next/standalone | ||
EXPOSE 3000 | ||
ENTRYPOINT [ "node", "server.js" ] |
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,11 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
# Run Next.js build with passed arguments | ||
next build "$@" | ||
|
||
# Copy files only if not in a CI environment | ||
if [ -z "$CI" ]; then | ||
cp -r ./public ./.next/standalone/public | ||
cp -r ./.next/static ./.next/standalone/.next/static | ||
fi |
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,4 @@ | ||
{ | ||
"schemaVersion": 2, | ||
"dockerfilePath": "./Dockerfile" | ||
} |
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
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
Empty file.