Skip to content

Commit

Permalink
Merge remote-tracking branch 'azureblade/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
PlamenErmenkov committed Jun 16, 2024
2 parents 2c899db + 8d4b3c3 commit a831b92
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 1 deletion.
30 changes: 30 additions & 0 deletions .github/workflows/deploy.yml
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/tar-action@v1.1.0
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 }}'
40 changes: 40 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
FROM node:lts-alpine3.20 as base

FROM base AS builder

# RUN apk add --no-cache libc6-compat
# RUN apk update

WORKDIR /app

COPY . .

ENV BUILDING true

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"]
4 changes: 4 additions & 0 deletions captain-definition
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"schemaVersion": 2,
"dockerfilePath": "./Dockerfile"
}
4 changes: 3 additions & 1 deletion next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/** @type {import('next').NextConfig} */
const nextConfig = {};
const nextConfig = {
output: 'standalone',
};

export default nextConfig;

0 comments on commit a831b92

Please sign in to comment.