Added compose files for local development and other tweaks

This commit is contained in:
Viswamedha Nalabotu 2025-11-18 21:39:01 +00:00
parent ff0d336cb3
commit 3c6e5e091c
15 changed files with 229 additions and 13 deletions

3
.gitignore vendored
View file

@ -47,4 +47,5 @@ Thumbs.db
vite.config.*.timestamp*
vitest.config.*.timestamp*
.env
.env
static

View file

@ -0,0 +1,28 @@
services:
web:
build:
context: ../..
dockerfile: compose/dev/node/Dockerfile
environment:
NODE_ENV: development
ports:
- "0.0.0.0:5173:5173"
volumes:
- ../../src:/app/src
- ../../index.html:/app/index.html
- ../../vite.config.ts:/app/vite.config.ts
- ../../tsconfig.json:/app/tsconfig.json
api:
build:
context: ../..
dockerfile: compose/dev/python/Dockerfile
ports:
- "0.0.0.0:8000:8000"
volumes:
- ../../:/app:cached
- ../../build:/app/build

View file

@ -0,0 +1,13 @@
FROM node:22-bullseye
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm install
COPY src ./src
COPY index.html .
COPY vite.config.* .
COPY tsconfig.* .
CMD ["npm", "run", "dev", "--", "--host", "0.0.0.0"]

View file

@ -0,0 +1,39 @@
FROM node:22-alpine AS node
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY src ./src
COPY index.html .
COPY vite.config.* .
COPY tsconfig.* .
RUN npm run build
FROM python:3.14.0-bookworm as python
RUN apt-get update && apt-get install --no-install-recommends -y \
build-essential \
libpq-dev \
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
RUN pip install --no-cache-dir --requirement /requirements.txt
WORKDIR /app
RUN apt-get update && apt-get install --no-install-recommends -y \
sudo git bash-completion nano ssh
COPY . .
COPY --from=node /app/build ./build
COPY ./compose/prod/start /start
RUN sed -i 's/\r$//g' /start
RUN chmod +x /start
ENTRYPOINT ["/start"]

View file

@ -1,4 +1,4 @@
FROM node:22-alpine AS builder
FROM node:22-alpine AS node
WORKDIR /app
@ -11,21 +11,33 @@ RUN npm ci
COPY . .
RUN npm run build:api
RUN npm run build:web
RUN npm run build
FROM node:22-alpine
FROM python:3.14.0-bookworm as python
RUN apt-get update && apt-get install --no-install-recommends -y \
build-essential \
libpq-dev \
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
RUN pip install --no-cache-dir --requirement /requirements.txt
WORKDIR /app
RUN apt-get update && apt-get install --no-install-recommends -y \
sudo git bash-completion nano ssh
COPY . .
COPY package*.json ./
RUN npm ci --omit=dev
COPY --from=builder /app/dist/apps/api ./dist/api
COPY --from=builder /app/dist/apps/web ./dist/web
COPY --from=node /app/build ./build
COPY ./apps/api/src ./apps/api/src
COPY ./compose/prod/start /start
RUN sed -i 's/\r$//g' /start
RUN chmod +x /start
EXPOSE 3000
CMD ["node", "dist/api/main.js"]
ENTRYPOINT ["/start"]

8
compose/prod/start Normal file
View file

@ -0,0 +1,8 @@
#!/bin/bash
set -o errexit
set -o pipefail
set -o nounset
python manage.py collectstatic --noinput
exec /usr/local/bin/gunicorn config.wsgi --bind 0.0.0.0:8000

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -115,6 +115,7 @@ USE_TZ = True
# https://docs.djangoproject.com/en/5.2/howto/static-files/
STATIC_URL = 'static/'
STATIC_ROOT = 'static/'
# Default primary key field type
# https://docs.djangoproject.com/en/5.2/ref/settings/#default-auto-field

View file

@ -9,6 +9,7 @@ export default [
{
ignores: [
'**/dist',
'**/build',
'**/vite.config.*.timestamp*',
'**/vitest.config.*.timestamp*'
]

113
requirements.txt Normal file
View file

@ -0,0 +1,113 @@
aiohappyeyeballs==2.6.1
aiohttp==3.13.2
aiosignal==1.4.0
annotated-types==0.7.0
anyio==4.11.0
asgiref==3.10.0
asttokens==3.0.0
attrs==25.4.0
beautifulsoup4==4.14.2
brotli==1.2.0
cachetools==6.2.1
certifi==2025.10.5
charset-normalizer==3.4.4
click==8.3.0
colorama==0.4.6
comm==0.2.3
dataclasses-json==0.6.7
ddgs==9.9.0
debugpy==1.8.17
decorator==5.2.1
Django==5.2.8
duckduckgo_search==8.1.1
executing==2.2.1
filetype==1.2.0
frozenlist==1.8.0
google-ai-generativelanguage==0.9.0
google-api-core==2.28.1
google-auth==2.43.0
googleapis-common-protos==1.72.0
greenlet==3.2.4
grpcio==1.76.0
grpcio-status==1.76.0
gunicorn==23.0.0
h11==0.16.0
h2==4.3.0
hpack==4.1.0
httpcore==1.0.9
httpx==0.28.1
httpx-sse==0.4.3
hyperframe==6.1.0
idna==3.11
ipykernel==7.1.0
ipython==9.7.0
ipython_pygments_lexers==1.1.1
jedi==0.19.2
jsonpatch==1.33
jsonpointer==3.0.0
jupyter_client==8.6.3
jupyter_core==5.9.1
langchain==1.0.5
langchain-classic==1.0.0
langchain-community==0.4.1
langchain-core==1.0.4
langchain-google-genai==3.0.1
langchain-text-splitters==1.0.0
langgraph==1.0.3
langgraph-checkpoint==3.0.1
langgraph-prebuilt==1.0.2
langgraph-sdk==0.2.9
langsmith==0.4.42
lxml==6.0.2
marshmallow==3.26.1
matplotlib-inline==0.2.1
multidict==6.7.0
mypy_extensions==1.1.0
nest-asyncio==1.6.0
numpy==2.3.4
orjson==3.11.4
ormsgpack==1.12.0
packaging==25.0
parso==0.8.5
pip3-autoremove==2.0.1
platformdirs==4.5.0
primp==0.15.0
prompt_toolkit==3.0.52
propcache==0.4.1
proto-plus==1.26.1
protobuf==6.33.0
psutil==7.1.3
pure_eval==0.2.3
pyasn1==0.6.1
pyasn1_modules==0.4.2
pydantic==2.12.4
pydantic-settings==2.11.0
pydantic_core==2.41.5
Pygments==2.19.2
python-dateutil==2.9.0.post0
python-dotenv==1.2.1
PyYAML==6.0.3
pyzmq==27.1.0
requests==2.32.5
requests-toolbelt==1.0.0
rsa==4.9.1
six==1.17.0
sniffio==1.3.1
socksio==1.0.0
soupsieve==2.8
SQLAlchemy==2.0.44
sqlmodel==0.0.27
sqlparse==0.5.3
stack-data==0.6.3
tenacity==9.1.2
tornado==6.5.2
traitlets==5.14.3
typing-inspect==0.9.0
typing-inspection==0.4.2
typing_extensions==4.15.0
tzdata==2025.2
urllib3==2.5.0
wcwidth==0.2.14
xxhash==3.6.0
yarl==1.22.0
zstandard==0.25.0

View file

@ -22,7 +22,7 @@
"types": ["vite/client"],
"baseUrl": ".",
"paths": {},
"outDir": "../../dist/out-tsc",
"outDir": "./build/out-tsc",
"lib": ["es2020", "dom"]
},
"include": [

View file

@ -6,7 +6,7 @@ export default defineConfig(() => ({
root: __dirname,
cacheDir: './node_modules/.vite/build',
server: {
port: 4200,
port: 5173,
host: 'localhost',
},
preview: {