What should I do to allow revalidate or rebuild a page using nextjs in fly.io?

I am wondering what should I do to make revalidation or rebuild a page works when the next.js project is deployed? In local enviorement works, I meant, if I create new info and the new page is available the revelations works and create the new page. But, it does not works in fly.io.

My dockerfile:

# syntax = docker/dockerfile:1

# Adjust NODE_VERSION as desired
ARG NODE_VERSION=18.12.0
FROM node:${NODE_VERSION}-slim as base

WORKDIR /app

ENV NODE_ENV=production
ENV PORT=3000

# Throw-away build stage to reduce size of final image
FROM base as build

# Install packages needed to build node modules
RUN apt-get update -qq && \
    apt-get install -y python-is-python3 pkg-config build-essential 

# Install node modules
COPY package.json package-lock.json ./
RUN npm ci --include=dev

# Copy application code
COPY . .

# Build application
RUN npm run build

# Remove development dependencies
RUN npm prune --production

# Final stage for app image
FROM base

# Copy built application
COPY --from=build /app/next.config.js .
COPY --from=build /app/package.json .
COPY --from=build /app/.next ./.next
COPY --from=build /app/node_modules ./node_modules

# Start the server by default, this can be overwritten at runtime
EXPOSE 3000
CMD [ "npm", "start" ]

My fly.toml:

# fly.toml app configuration file generated for cinema-memory-next on 2023-06-13T23:40:10-03:00
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#

app = "app"
primary_region = "eze"

[http_service]
  internal_port = 3000
  force_https = true
  auto_stop_machines = true
  auto_start_machines = true
  min_machines_running = 0

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.