From 3d3c9024094820c51965d7ee13f2a1ef436fd21d Mon Sep 17 00:00:00 2001 From: victor <52110451+cs50victor@users.noreply.github.com> Date: Sat, 2 Mar 2024 13:48:26 -0500 Subject: [PATCH] feat: deploy docker backend on fly.io (#12) * feat: vercel analytics * feat:fly.io * feat: dockerfile --- .dockerignore | 3 ++- .python-version | 1 + Dockerfile | 7 ++++--- README.md | 3 ++- app/layout.tsx | 2 ++ fly.toml | 23 +++++++++++++++++++++++ package.json | 1 + pnpm-lock.yaml | 23 +++++++++++++++++++++++ requirements.txt | 49 ++++++------------------------------------------ 9 files changed, 64 insertions(+), 48 deletions(-) create mode 100644 .python-version create mode 100644 fly.toml diff --git a/.dockerignore b/.dockerignore index 35f68de..1cbb524 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,2 +1,3 @@ * -!server/**.py \ No newline at end of file +!server/**.py +!requirements.txt \ No newline at end of file diff --git a/.python-version b/.python-version new file mode 100644 index 0000000..171a6a9 --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.12.1 diff --git a/Dockerfile b/Dockerfile index c49b360..91178fe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1 -ARG PYTHON_VERSION=3.11.6 +ARG PYTHON_VERSION=3.12.1 FROM python:${PYTHON_VERSION}-slim as base # Prevents Python from writing pyc files. @@ -27,10 +27,11 @@ RUN adduser \ # Copy the source code into the container. COPY . . -RUN python -m pip install -r requirements.txt +RUN pip install -r requirements.txt +RUN pip install supabase # Switch to the non-privileged user to run the application. USER appuser # Run the application. -CMD python agent.py start \ No newline at end of file +CMD python server/agent.py start \ No newline at end of file diff --git a/README.md b/README.md index 93fabb4..3a634a3 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ # Buildspace AI + `find and be found.` -a more detailed docs coming soon. +a more detailed docs coming soon. ## setup for mac diff --git a/app/layout.tsx b/app/layout.tsx index b7d072c..0b34ae8 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -1,3 +1,4 @@ +import { Analytics } from '@vercel/analytics/react'; import type { Metadata } from 'next'; import { Inter, Roboto } from 'next/font/google'; @@ -34,6 +35,7 @@ export default function RootLayout({ children }: { children: React.ReactNode }) >
{children} +