-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
18 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Use an official Node.js 22 as a parent image | ||
FROM node:22-alpine | ||
|
||
WORKDIR /usr/src/app | ||
|
||
# ARG for build-time variable (GATEWAY_API_URL) | ||
ARG GATEWAY_API_URL | ||
|
||
# ENV for URL to be used in the app | ||
ENV NEXT_PUBLIC_API_GATEWAY_URL=${GATEWAY_API_URL} | ||
|
||
# Copy package.json and package-lock.json (or yarn.lock) into the container | ||
COPY package*.json ./ | ||
|
||
RUN npm install | ||
COPY . . | ||
RUN npm run build | ||
CMD ["npm", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,9 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = { | ||
reactStrictMode: true, | ||
output: "export", | ||
// distDir should be "../api/static" in production but .next in development | ||
distDir: process.env.NODE_ENV === "development" ? ".next" : "../api/static", | ||
images: { | ||
unoptimized: true, | ||
}, | ||
// base path for static files should be "" in development but "/static" in production | ||
basePath: process.env.NODE_ENV === "development" ? "" : "/static", | ||
}; | ||
|
||
module.exports = nextConfig; |