Trying to deploy my Next.JS app, which in the past deployed just fine.
==> Building image with Depot
--> build: ()
[+] Building 7.0s (5/5) FINISHED
=> [internal] load build definition from Dockerfile 0.3s
=> => transferring dockerfile: 1.09kB 0.3s
=> resolve image config for docker-image://docker.io/docker/dockerfile:1 3.5s
=> docker-image://docker.io/docker/dockerfile:1@sha256:865e5dd094beca432e8c0a1d5e1c465db5f998dca4e439981029b3b81fb39ed5 0.5s
=> => resolve docker.io/docker/dockerfile:1@sha256:865e5dd094beca432e8c0a1d5e1c465db5f998dca4e439981029b3b81fb39ed5 0.0s
=> => sha256:1e45ed8b8be3fcf5baec105c530196be8d0b853893e209e4adf6c0e925079ff0 12.49MB / 12.49MB 0.4s
=> => extracting sha256:1e45ed8b8be3fcf5baec105c530196be8d0b853893e209e4adf6c0e925079ff0 0.1s
=> [internal] load metadata for docker.io/library/node:23-slim 1.7s
=> [internal] load .dockerignore 0.3s
=> => transferring context: 514B 0.3s
==> Building image
Waiting for depot builder...
Waiting for depot builder...
Waiting for depot builder...
Waiting for depot builder...
Waiting for depot builder...
==> Building image with Depot
--> build: ()
[+] Building 1.2s (5/5) FINISHED
=> [internal] load build definition from Dockerfile 0.2s
=> => transferring dockerfile: 1.09kB 0.2s
=> resolve image config for docker-image://docker.io/docker/dockerfile:1 0.3s
=> CACHED docker-image://docker.io/docker/dockerfile:1@sha256:865e5dd094beca432e8c0a1d5e1c465db5f998dca4e439981029b3b81fb39ed5 0.0s
=> => resolve docker.io/docker/dockerfile:1@sha256:865e5dd094beca432e8c0a1d5e1c465db5f998dca4e439981029b3b81fb39ed5 0.0s
=> [internal] load metadata for docker.io/library/node:23-slim 0.3s
=> [internal] load .dockerignore 0.2s
=> => transferring context: 514B 0.2s
Error: failed to fetch an image or build from source: error building: failed to solve: exit code: 2
# syntax = docker/dockerfile:1
# Adjust NODE_VERSION as desired
ARG NODE_VERSION=23
FROM node:23-slim as base
LABEL fly_launch_runtime="Next.js"
# Next.js app lives here
WORKDIR /app
# Set production environment
ENV NODE_ENV="production"
ARG YARN_VERSION=1.22.19
# Install Yarn 3
RUN corepack enable && \
yarn set version ${YARN_VERSION}
# 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 build-essential pkg-config python-is-python3
# Install node modules
COPY --link package.json tsconfig.json next.config.js yarn.lock .yarnrc.yml ./
RUN yarn install --immutable --production=false
# Copy application code
COPY --link . .
# Build application
RUN yarn run build
# Remove development dependencies
RUN yarn install
# Final stage for app image
FROM base
# Copy built application
COPY --from=build /app /app
# Start the server by default, this can be overwritten at runtime
EXPOSE 3000
CMD [ "yarn", "run", "start" ]
# fly.toml app configuration file generated for sunway-bcc on 2024-05-02T10:01:29+08:00
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#
app = 'sunway-bcc'
primary_region = 'sin'
[build]
[env]
NEXT_PUBLIC_ALCHEMY_ID = <REDACTED>
[http_service]
internal_port = 3000
force_https = true
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 0
processes = ['app']
[[vm]]
cpu_kind = 'shared'
cpus = 1
memory_mb = 512