25 lines
562 B
Docker
25 lines
562 B
Docker
# Use Deno image
|
|
FROM denoland/deno:alpine
|
|
|
|
# Set working directory
|
|
WORKDIR /app
|
|
|
|
# Copy project files
|
|
COPY . .
|
|
|
|
ENV NODE_ENV=production
|
|
RUN deno install
|
|
|
|
# Install Next.js dependencies
|
|
RUN deno task build
|
|
|
|
# Move everything to the standalone
|
|
RUN cp -r public .next/standalone/public
|
|
RUN cp -r .next/static .next/standalone/.next/static
|
|
RUN mv .next/standalone/server.js .next/standalone/server.cjs
|
|
|
|
RUN rm -r ./node_modules
|
|
|
|
# Start the Next.js app
|
|
CMD ["deno", "run", "--allow-env", "--allow-read", "--allow-sys", "--allow-net", ".next/standalone/server.cjs"]
|