-
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
3511996
commit c059261
Showing
5 changed files
with
80 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,4 @@ | ||
.next | ||
node_modules | ||
.git | ||
.gitignore |
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 @@ | ||
DB_HOST= | ||
DB_USER= | ||
DB_PASS= | ||
DB_DATABASE=project-f |
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,30 @@ | ||
name: Deploy | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
deploy: | ||
name: Build & deplo | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 1 | ||
|
||
- name: Compress | ||
uses: a7ul/[email protected] | ||
with: | ||
command: c | ||
files: ./ | ||
outPath: ./deploy.tar | ||
|
||
- name: Deploy the tar to caprover | ||
uses: caprover/deploy-from-github@main | ||
with: | ||
server: '${{ secrets.CAPROVER_SERVER }}' | ||
app: '${{ secrets.APP_NAME }}' | ||
token: '${{ secrets.APP_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,38 @@ | ||
FROM node:lts-alpine3.20 as base | ||
|
||
FROM base AS builder | ||
|
||
# RUN apk add --no-cache libc6-compat | ||
# RUN apk update | ||
|
||
WORKDIR /app | ||
|
||
COPY . . | ||
|
||
RUN npm install | ||
RUN npm run build | ||
|
||
FROM base AS runner | ||
WORKDIR /app | ||
|
||
COPY --from=builder /app/public ./public | ||
|
||
RUN addgroup --system --gid 1001 nodejs | ||
RUN adduser --system --uid 1001 nextjs | ||
|
||
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 | ||
|
||
ENV PORT 3000 | ||
ENV HOSTNAME 0.0.0.0 | ||
ENV NEXT_TELEMETRY_DISABLED 1 | ||
ENV NODE_ENV production | ||
|
||
EXPOSE 3000 | ||
|
||
CMD ["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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"schemaVersion": 2, | ||
"dockerfilePath": "./Dockerfile" | ||
} |