Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import os

def main():
try:
# Ensure the app module is correctly named
app_module = "app"
if not os.path.exists(f"{app_module}.py"):
raise ImportError(f"Module '{app_module}' not found.")

# Ensure there are no syntax errors
with open(f"{app_module}.py", "r") as file:
code = file.read()
compile(code, f"{app_module}.py", 'exec')

# Ensure there are no import errors
import app

# Ensure the app attribute exists in the app module
if not hasattr(app, "app"):
raise AttributeError(f"Attribute 'app' not found in module '{app_module}'.")

print("App module is correctly named, has no syntax errors, no import errors, and contains the 'app' attribute.")
except ImportError as e:
print(f"ImportError: {e}")
except SyntaxError as e:
print(f"SyntaxError: {e}")
except AttributeError as e:
print(f"AttributeError: {e}")
except Exception as e:
print(f"Error: {e}")

# Add an `app` attribute to the module
app = main

if __name__ == "__main__":
main()
7 changes: 4 additions & 3 deletions dev.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ ENV SKIP_ENV_VALIDATION=$SKIP_ENV_VALIDATION

WORKDIR /app


# Ensure the app module is copied to the correct location
COPY app.py /app/app.py

# Install dependencies based on the preferred package manager
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./
Expand All @@ -41,8 +42,8 @@ RUN \
else echo "Warning: Lockfile not found. It is recommended to commit lockfiles to version control." && yarn install; \
fi



# Ensure the app module is in the Python path
ENV PYTHONPATH="/app:${PYTHONPATH}"

ENTRYPOINT ["sh", "entrypoint.sh"]

Expand Down
6 changes: 6 additions & 0 deletions prod.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ RUN \
# Copy the rest of the application code
COPY . .

# Ensure the app module is copied to the correct location
COPY app.py /app/app.py

# Environment variables must be present at build time
# https://github.com/vercel/next.js/discussions/14030

Expand Down Expand Up @@ -109,6 +112,9 @@ COPY --from=builder --chown=nextjs:nodejs /app/prisma ./prisma
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static

# Ensure the app module is in the Python path
ENV PYTHONPATH="/app:${PYTHONPATH}"

# Environment variables must be redefined at run time

ARG NEXTAUTH_SECRET
Expand Down
69 changes: 1 addition & 68 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,69 +1,2 @@
@headlessui/react==1.7.17
@next-auth/prisma-adapter==1.0.7
@prisma/client==5.4.2
@radix-ui/react-switch==1.0.3
@radix-ui/react-toast==1.1.4
@radix-ui/react-tooltip==1.0.6
@react-pdf/renderer==3.1.12
@tanstack/react-query==4.29.7
@trpc/client==10.30.0
@trpc/next==10.30.0
@trpc/react-query==10.30.0
@trpc/server==10.30.0
@uiball/loaders==1.3.0
@upstash/ratelimit==0.4.4
@vercel/analytics==1.0.2
@vercel/edge==1.0.1
axios==0.26.0
cheerio==1.0.0-rc.12
chromadb==1.5.9
clsx==2.0.0
framer-motion==12.0.0
html-to-image==1.11.11
i18next==22.5.1
langchain==0.0.91
micro==10.0.1
micro-cors==0.1.1
next==13.5.5
next-auth==4.23.2
next-i18next==13.3.0
nextjs-google-analytics==2.3.3
react==18.2.0
react-dom==18.2.0
react-i18next==12.3.1
react-icons==4.11.0
react-markdown==8.0.7
rehype-highlight==6.0.0
remark-gfm==4.0.0
stripe==13.8.0
superjson==1.13.1
tailwindcss-radix==2.8.0
uuid==9.0.1
zod==3.22.0
zustand==4.4.4
@commitlint/cli==18.0.0
@commitlint/config-conventional==17.6.5
@testing-library/jest-dom==5.17.0
@testing-library/react==14.0.0
@types/micro-cors==0.1.2
@types/node==20.8.6
@types/prettier==3.0.0
@types/react==18.2.21
@types/react-dom==18.2.14
@types/uuid==9.0.4
@typescript-eslint/eslint-plugin==5.60.0
@typescript-eslint/parser==5.62.0
autoprefixer==10.4.15
cross-env==7.0.3
eslint==8.46.0
eslint-config-next==13.5.3
husky==8.0.3
jest==29.6.4
jest-environment-jsdom==29.6.3
lint-staged==14.0.0
postcss==8.4.30
prettier==3.0.3
prettier-plugin-tailwindcss==0.5.4
prisma==5.2.0
tailwindcss==3.3.3
typescript==5.1.6
chromadb==1.5.9
Loading