Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 0 additions & 67 deletions .env.example

This file was deleted.

54 changes: 54 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
FROM oven/bun:alpine AS base
WORKDIR /app

# Install dependencies only when needed
FROM base AS deps
COPY package.json bun.lock ./
# bun install
RUN bun install --frozen-lockfile

# Rebuild the source code only when needed
FROM base AS builder
COPY . .
COPY --from=deps /app/node_modules ./node_modules

# Next.js may need this at build time
ARG DATABASE_URL
ENV DATABASE_URL=${DATABASE_URL}
ENV NEXT_TELEMETRY_DISABLED 1

# Start build
RUN bun run build

# Production image, copy all the files and run next
FROM base AS runner
WORKDIR /app

ENV NODE_ENV production
ENV NEXT_TELEMETRY_DISABLED 1

RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs

COPY --from=builder /app/public ./public

# Set the correct permission for prerender cache
RUN mkdir .next
RUN chown nextjs:nodejs .next

# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
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
# set hostname to localhost
ENV HOSTNAME "0.0.0.0"

# server.js is created by next build from the standalone output
# https://nextjs.org/docs/pages/api-reference/next-config-js/output
CMD ["bun", "server.js"]
8 changes: 7 additions & 1 deletion bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added check.txt
Binary file not shown.
45 changes: 45 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
version: '3.8'

services:
db:
image: postgres:15-alpine
container_name: relivator-db
restart: always
environment:
POSTGRES_USER: user
POSTGRES_PASSWORD: password
POSTGRES_DB: relivator
ports:
- "5432:5432"
volumes:
- db_data:/var/lib/postgresql/data

app:
build:
context: .
args:
# Pass required build-time variables here
- DATABASE_URL=postgresql://user:password@db:5432/relivator
container_name: relivator-app
restart: always
ports:
- "3000:3000"
environment:
- DATABASE_URL=postgresql://user:password@db:5432/relivator
# Add other environment variables from .env here
- AUTH_SECRET=mysecret
- AUTH_GOOGLE_ID=googleid
- AUTH_GOOGLE_SECRET=googlesecret
- AUTH_GITHUB_ID=githubid
- AUTH_GITHUB_SECRET=githubsecret
- UPLOADTHING_TOKEN=uploadthing
- UPLOADTHING_SECRET_KEY=sk_live_uploadthing
- POLAR_ACCESS_TOKEN=polar
- POLAR_WEBHOOK_SECRET=polarwebhook
- POLAR_ENVIRONMENT=sandbox
- NEXT_PUBLIC_APP_URL=http://localhost:3000
depends_on:
- db

volumes:
db_data:
1 change: 1 addition & 0 deletions eslint.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ export default {
{ hostname: "utfs.io", protocol: "https" },
],
},
output: "standalone",
serverExternalPackages: ["@noble/hashes"],
} satisfies NextConfig;
Loading