diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..6f7e304 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,8 @@ +Dockerfile +.dockerignore +node_modules +npm-debug.log +README.md +.env* +.next +.git \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..238b74d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +FROM node:22-slim AS base +ENV NEXT_TELEMETRY_DISABLED=1 +WORKDIR /app + +# Dependencies +FROM base AS dependencies +COPY package.json package-lock.json ./ +RUN npm ci + +# Build +FROM base AS build +COPY --from=dependencies /app/node_modules ./node_modules +COPY . . +RUN npm run build + +# Run +FROM base AS run +ENV NODE_ENV=production +RUN mkdir .next +COPY --from=build /app/public ./public +COPY --from=build /app/.next/standalone ./ +COPY --from=build /app/.next/static ./.next/static +CMD ["node", "server.js"] \ No newline at end of file diff --git a/next.config.js b/next.config.js index ed00e79..d552aa7 100644 --- a/next.config.js +++ b/next.config.js @@ -2,4 +2,5 @@ module.exports = { images: { domains: ['res.cloudinary.com'], }, + output: 'standalone', }; diff --git a/pages/api/v1/rates.js b/pages/api/v1/rates.js index 06c6b5e..a7d2a0c 100644 --- a/pages/api/v1/rates.js +++ b/pages/api/v1/rates.js @@ -214,7 +214,7 @@ export default async (req, res) => { .then((result) => { const nalaRates = result.data.find( (data) => { - return data.source_currency == "EUR" && data.destination_currency === "NGN" + return data.source_currency === "EUR" && data.destination_currency === "NGN" && data.provider_name === "nala" } ) // console.log("NALA<<<<<<<", nalaRates)