Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docker support #86

Merged
merged 13 commits into from
Oct 19, 2024
13 changes: 13 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Dockerfile
.dockerignore
node_modules
README.md
.next
.vscode
.git
.github
.husky
.eslintrc.json
.prettierrc
.env
.env.*
Empty file removed .vercelignore
Empty file.
27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM node:alpine AS build

WORKDIR /app

COPY package*.json ./
COPY prisma/schema.prisma ./prisma/schema.prisma

# Clean install
RUN npm ci

COPY . .

ARG DATABASE_URL=${DATABASE_URL}

RUN npm run build

FROM node:alpine AS runtime

WORKDIR /app

COPY --from=build /app/.next ./.next

ENV NODE_ENV production

EXPOSE 3000

CMD ["node", ".next/standalone/server.js"]
4 changes: 1 addition & 3 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ const nextConfig = {
},
],
},
experimental: {
appDir: true,
},
output: "standalone",
}

module.exports = nextConfig
Loading