Reduced docker image size
This commit is contained in:
1
.dockerignore
Normal file
1
.dockerignore
Normal file
@@ -0,0 +1 @@
|
||||
./latosa-frontend/node_modules/
|
||||
10
Dockerfile
10
Dockerfile
@@ -7,13 +7,21 @@ WORKDIR /app
|
||||
# Copy project files
|
||||
COPY ./latosa-frontend/ .
|
||||
|
||||
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
|
||||
|
||||
# Expose the default Next.js port
|
||||
EXPOSE 3000
|
||||
|
||||
# Start the Next.js app
|
||||
CMD ["deno", "task", "start"]
|
||||
CMD ["deno", "run", "--allow-env", "--allow-read", "--allow-sys", "--allow-net", ".next/standalone/server.cjs"]
|
||||
|
||||
@@ -2,6 +2,7 @@ import type { NextConfig } from "next";
|
||||
|
||||
const nextConfig: NextConfig = {
|
||||
/* config options here */
|
||||
output: "standalone",
|
||||
};
|
||||
|
||||
export default nextConfig;
|
||||
|
||||
Reference in New Issue
Block a user