Some hard coding at least for now

This commit is contained in:
Tiago Ribeiro
2024-09-07 23:51:04 +01:00
parent d91b1c14e7
commit bf0d696b2f
2 changed files with 6 additions and 0 deletions

View File

@@ -47,6 +47,8 @@ COPY --from=builder /app/public ./public
COPY --from=builder --chown=1001:1001 /app/.next/standalone ./
COPY --from=builder --chown=1001:1001 /app/.next/static ./.next/static
ENV MONGODB_URI "mongodb+srv://user:JKpFBymv0WLv3STj@encoach.lz18a.mongodb.net/?retryWrites=true&w=majority&appName=EnCoach"
USER nextjs
EXPOSE 3000

View File

@@ -1,5 +1,9 @@
import {MongoClient} from "mongodb";
if (!process.env.MONGODB_URI) {
throw new Error('Invalid/Missing environment variable: "MONGODB_URI"');
}
const uri = process.env.MONGODB_URI || "";
const options = {};