This repository has been archived by the owner on Feb 10, 2025. It is now read-only.
-
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
Showing
5 changed files
with
59 additions
and
16 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,13 @@ | ||
Dockerfile | ||
.dockerignore | ||
node_modules | ||
npm-debug.log | ||
README.md | ||
.pnpm | ||
.next | ||
.git | ||
**/*.db | ||
prisma/migrations/ | ||
|
||
!.next/static | ||
!.next/standalone |
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 |
---|---|---|
|
@@ -40,3 +40,7 @@ next-env.d.ts | |
/prisma/migrations/ | ||
*.db | ||
*.db-journal | ||
|
||
# Docker | ||
.docker_temp_* | ||
*.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 |
---|---|---|
@@ -1,24 +1,37 @@ | ||
# Use Node.js 20 as the base image | ||
FROM node:20 | ||
FROM node:20-alpine AS base | ||
|
||
# Build stage | ||
FROM base AS build | ||
|
||
# Set the working directory inside the container | ||
WORKDIR /app | ||
|
||
# Copy package.json and pnpm-lock.yaml (or package-lock.json) | ||
COPY package*.json ./ | ||
ENV DATABASE_URL=file:/app/db/hie_sqlite.db | ||
|
||
# Install dependencies using pnpm | ||
RUN npm install -g pnpm | ||
RUN pnpm install | ||
COPY package.json pnpm-lock.yaml* ./ | ||
RUN corepack enable pnpm && pnpm install --frozen-lockfile | ||
|
||
# Copy the rest of the application code | ||
COPY . . | ||
RUN pnpm run prisma:update && pnpm run build | ||
|
||
# Expose the port your Next.js app will run on | ||
EXPOSE 3000 | ||
# Remove dev dependencies | ||
RUN pnpm prune --prod | ||
|
||
# Production stage | ||
FROM base | ||
|
||
WORKDIR /app | ||
|
||
# Build the Next.js app | ||
RUN pnpm run build | ||
ENV NODE_ENV=production | ||
ENV DATABASE_URL=file:/app/db/hie_sqlite.db | ||
|
||
RUN npm install -g pnpm | ||
|
||
COPY --from=build /app/db/hie_sqlite.db /app/db/hie_sqlite.db | ||
COPY --from=build /app/.next /app/.next | ||
COPY --from=build /app/node_modules /app/node_modules | ||
COPY --from=build /app/package.json /app/package.json | ||
COPY --from=build /app/public /app/public | ||
|
||
EXPOSE 3000 | ||
|
||
# Start the app | ||
CMD ["pnpm", "start"] | ||
CMD ["pnpm", "run", "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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
version: "3" | ||
services: | ||
app: | ||
image: hie | ||
build: | ||
context: . | ||
ports: | ||
- "5888:3000" | ||
volumes: | ||
- HOST_DIR:/app/data | ||
# restart: always |
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,6 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = {}; | ||
const nextConfig = { | ||
output: "standalone", | ||
}; | ||
|
||
export default nextConfig; |