Setup docker for production and development
Change ./init.sh to be an executable then run it. The default inner container ports are as followed: - Postgres: 5432:5432 - Backend: 3001:3000 - Frontend: 3000:3000 - Frontend dev: 8000 The backend image needs to be built: docker compose up -d --build
This commit is contained in:
27
frontend/Dockerfile
Normal file
27
frontend/Dockerfile
Normal file
@@ -0,0 +1,27 @@
|
||||
# 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
|
||||
|
||||
# Expose the default Next.js port
|
||||
EXPOSE 3000
|
||||
|
||||
# Start the Next.js app
|
||||
CMD ["deno", "run", "--allow-env", "--allow-read", "--allow-sys", "--allow-net", ".next/standalone/server.cjs"]
|
||||
Reference in New Issue
Block a user