diff --git a/Dockerfile b/Dockerfile index 0d307a6..d264219 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,18 +6,23 @@ RUN corepack enable # Set the working directory in the container WORKDIR /usr/src/app -# Copy the current directory contents into the container at /usr/src/app +# Copy your manifest files first for better caching +COPY package.json yarn.lock ./ + +# Install ALL dependencies (including devDependencies) +RUN yarn install --production=false + +# Copy the rest of your project COPY . . -# Install your app dependencies using the npm binary -RUN yarn +# Build the Next.js app RUN yarn build # Install PM2 globally RUN npm install pm2 -g -# Your app binds to port 3000 so you'll use the EXPOSE instruction to have it mapped by the docker daemon +# App listens on port 3000 EXPOSE 3000 -# Define the runtime command to run your application +# Run Next using PM2 CMD ["pm2-runtime", "start", "npm", "--", "start"] diff --git a/package.json b/package.json index ed07c10..19bebe1 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "presence-tracker", + "name": "planning-fight", "version": "0.1.0", "private": true, "scripts": {