2023-09-20 17:16:50 +03:00
|
|
|
FROM node:18.13.0-alpine
|
2023-05-24 18:22:54 +03:00
|
|
|
# Install Python and essential build tools
|
|
|
|
RUN apk add --update --no-cache python3 make g++ && ln -sf python3 /usr/bin/python
|
|
|
|
RUN python3 -m ensurepip
|
|
|
|
RUN pip3 install --no-cache --upgrade pip setuptools
|
2023-05-21 02:20:55 +03:00
|
|
|
|
|
|
|
# Create the directory on the node image
|
|
|
|
# where our Next.js app will live
|
|
|
|
RUN mkdir -p /app
|
|
|
|
|
|
|
|
# Set /app as the working directory
|
|
|
|
WORKDIR /app
|
|
|
|
|
2023-05-30 20:16:28 +03:00
|
|
|
# Copy package.json and yarn.lock
|
2023-05-21 02:20:55 +03:00
|
|
|
# to the /app working directory
|
2023-05-30 20:16:28 +03:00
|
|
|
COPY package*.json yarn.lock ./
|
2023-05-21 02:20:55 +03:00
|
|
|
|
|
|
|
# Install dependencies in /app
|
2023-07-16 00:22:17 +03:00
|
|
|
RUN yarn install --network-timeout 1000000
|
2023-05-21 02:20:55 +03:00
|
|
|
|
|
|
|
# Copy the rest of our Next.js folder into /app
|
2023-05-24 18:22:54 +03:00
|
|
|
COPY . .
|
2023-05-21 02:20:55 +03:00
|
|
|
|
2023-06-04 00:12:42 +03:00
|
|
|
# Build the Next.js application
|
|
|
|
RUN yarn build
|
|
|
|
|
2023-05-21 02:20:55 +03:00
|
|
|
# Ensure port 3000 is accessible to our system
|
|
|
|
EXPOSE 3000
|
|
|
|
|
2023-06-04 00:12:42 +03:00
|
|
|
# Run yarn start, as we would via the command line
|
2023-07-16 00:22:17 +03:00
|
|
|
CMD ["yarn", "start"]
|