forked from settlemint/settlemint-nextjs-wagmi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
33 lines (23 loc) · 834 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Use an official Node runtime as a parent image
FROM node:20-slim
# Install Python and other necessary build tools
RUN apt-get update && apt-get install -y python3 make g++ python3-dev
# Set the working directory in the container
WORKDIR /app
# Copy package.json and package-lock.json (if you're using one)
COPY package.json package-lock.json* ./
# Install dependencies
RUN npm i
# Copy the rest of your app's source code
COPY . .
# Create a writable directory for Next.js image cache
RUN mkdir -p /app/.next/cache/images && chmod 777 /app/.next/cache/images
# Build your Next.js app
RUN npm run build
# Expose the port your app runs on
EXPOSE 3000
# Set environment variable to use the writable cache directory
ENV NEXT_TELEMETRY_DISABLED 1
ENV NEXT_SHARP_PATH /app/node_modules/sharp
# Start the app
CMD ["npm", "start"]