Skip to content

Commit 71b1d90

Browse files
authored
Merge pull request #3 from upayanmazumder-DevLabs/dev
Backend
2 parents c0b9bd4 + 3692a27 commit 71b1d90

File tree

118 files changed

+11380
-28
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+11380
-28
lines changed

.github/workflows/docker-image.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Build and Push Docker image to GHCR
2+
3+
on:
4+
push:
5+
branches: [dev]
6+
workflow_dispatch:
7+
8+
jobs:
9+
build-and-push:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
packages: write
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Set up QEMU
20+
uses: docker/setup-qemu-action@v3
21+
22+
- name: Set up Docker Buildx
23+
uses: docker/setup-buildx-action@v3
24+
25+
- name: Log in to GHCR
26+
uses: docker/login-action@v3
27+
with:
28+
registry: ghcr.io
29+
username: ${{ github.actor }}
30+
password: ${{ secrets.GITHUB_TOKEN }}
31+
32+
- name: Set lowercase image name
33+
id: meta
34+
run: |
35+
IMAGE_NAME="ghcr.io/${GITHUB_REPOSITORY,,}:latest"
36+
echo "image=$IMAGE_NAME" >> $GITHUB_OUTPUT
37+
38+
- name: Build and push Docker image
39+
uses: docker/build-push-action@v5
40+
with:
41+
context: .
42+
push: true
43+
platforms: linux/amd64,linux/arm64
44+
tags: ${{ steps.meta.outputs.image }}

.gitignore

Lines changed: 202 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,202 @@
1+
2+
# Byte-compiled / optimized / DLL files
3+
__pycache__/
4+
*.py[cod]
5+
*$py.class
6+
7+
# C extensions
8+
*.so
9+
10+
# Distribution / packaging
11+
.Python
12+
build/
13+
develop-eggs/
14+
dist/
15+
downloads/
16+
eggs/
17+
.eggs/
18+
lib/
19+
lib64/
20+
parts/
21+
sdist/
22+
var/
23+
wheels/
24+
share/python-wheels/
25+
*.egg-info/
26+
.installed.cfg
27+
*.egg
28+
MANIFEST
29+
30+
# PyInstaller
31+
# Usually these files are written by a python script from a template
32+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
33+
*.manifest
34+
*.spec
35+
36+
# Installer logs
37+
pip-log.txt
38+
pip-delete-this-directory.txt
39+
40+
# Unit test / coverage reports
41+
htmlcov/
42+
.tox/
43+
.nox/
44+
.coverage
45+
.coverage.*
46+
.cache
47+
nosetests.xml
48+
coverage.xml
49+
*.cover
50+
*.py,cover
51+
.hypothesis/
52+
.pytest_cache/
53+
cover/
54+
55+
# Translations
56+
*.mo
57+
*.pot
58+
59+
# Django stuff:
60+
*.log
61+
local_settings.py
62+
db.sqlite3
63+
db.sqlite3-journal
64+
65+
# Flask stuff:
66+
instance/
67+
.webassets-cache
68+
69+
# Scrapy stuff:
70+
.scrapy
71+
72+
# Sphinx documentation
73+
docs/_build/
74+
75+
# PyBuilder
76+
.pybuilder/
77+
target/
78+
79+
# Jupyter Notebook
80+
.ipynb_checkpoints
81+
82+
# IPython
83+
profile_default/
84+
ipython_config.py
85+
86+
# pyenv
87+
# For a library or package, you might want to ignore these files since the code is
88+
# intended to run in multiple environments; otherwise, check them in:
89+
# .python-version
90+
91+
# pipenv
92+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
93+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
94+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
95+
# install all needed dependencies.
96+
#Pipfile.lock
97+
98+
# UV
99+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
100+
# This is especially recommended for binary packages to ensure reproducibility, and is more
101+
# commonly ignored for libraries.
102+
#uv.lock
103+
104+
# poetry
105+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
106+
# This is especially recommended for binary packages to ensure reproducibility, and is more
107+
# commonly ignored for libraries.
108+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
109+
#poetry.lock
110+
#poetry.toml
111+
112+
# pdm
113+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
114+
#pdm.lock
115+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
116+
# in version control.
117+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
118+
.pdm.toml
119+
.pdm-python
120+
.pdm-build/
121+
122+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
123+
__pypackages__/
124+
125+
# Celery stuff
126+
celerybeat-schedule
127+
celerybeat.pid
128+
129+
# SageMath parsed files
130+
*.sage.py
131+
132+
# Environments
133+
.env
134+
.venv
135+
env/
136+
venv/
137+
ENV/
138+
env.bak/
139+
venv.bak/
140+
141+
# Spyder project settings
142+
.spyderproject
143+
.spyproject
144+
145+
# Rope project settings
146+
.ropeproject
147+
148+
# mkdocs documentation
149+
/site
150+
151+
# mypy
152+
.mypy_cache/
153+
.dmypy.json
154+
dmypy.json
155+
156+
# Pyre type checker
157+
.pyre/
158+
159+
# pytype static type analyzer
160+
.pytype/
161+
162+
# Cython debug symbols
163+
cython_debug/
164+
165+
# PyCharm
166+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
167+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
168+
# and can be added to the global gitignore or merged into this file. For a more nuclear
169+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
170+
.idea/
171+
172+
# Abstra
173+
# Abstra is an AI-powered process automation framework.
174+
# Ignore directories containing user credentials, local state, and settings.
175+
# Learn more at https://abstra.io/docs
176+
.abstra/
177+
178+
# Visual Studio Code
179+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
180+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
181+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
182+
# you could uncomment the following to ignore the entire vscode folder
183+
.vscode/
184+
185+
# Ruff stuff:
186+
.ruff_cache/
187+
188+
# PyPI configuration file
189+
.pypirc
190+
191+
# Cursor
192+
# Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
193+
# exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
194+
# refer to https://docs.cursor.com/context/ignore-files
195+
.cursorignore
196+
.cursorindexingignore
197+
node_modules
198+
.env
199+
.DS_Store
200+
201+
*.txt
202+
test

.hooks/commit-msg

Lines changed: 0 additions & 11 deletions
This file was deleted.

.vscode/settings.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"cSpell.words": [
3+
"Buildx",
4+
"gdgvit",
5+
"kargo",
6+
"libc",
7+
"Mailgun",
8+
"NEXTAUTH",
9+
"upayan"
10+
],
11+
"colorWheel.settings.workspaceColor": "hsl(176,58%,68%)"
12+
}

Dockerfile

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# syntax=docker/dockerfile:1.5
2+
3+
FROM --platform=$BUILDPLATFORM node:20-slim AS base
4+
WORKDIR /app
5+
6+
RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends libc6 && rm -rf /var/lib/apt/lists/*
7+
8+
FROM base AS deps
9+
WORKDIR /app
10+
11+
COPY api/package.json api/package-lock.json* ./
12+
RUN npm ci
13+
14+
FROM base AS builder
15+
WORKDIR /app
16+
17+
COPY --from=deps /app/node_modules ./node_modules
18+
COPY api .
19+
20+
RUN npm run build
21+
22+
FROM node:20-slim AS runner
23+
WORKDIR /app
24+
25+
ENV NODE_ENV=production
26+
27+
RUN apt-get update && apt-get upgrade -y && rm -rf /var/lib/apt/lists/*
28+
29+
RUN apt-get update && \
30+
apt-get install -y --no-install-recommends python3 python3-pip && \
31+
ln -s /usr/bin/python3 /usr/bin/python && \
32+
rm -rf /var/lib/apt/lists/*
33+
34+
RUN apt-get update && \
35+
apt-get install -y --no-install-recommends curl ca-certificates && \
36+
curl -LO https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl && \
37+
install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl && \
38+
rm kubectl && \
39+
apt-get clean && rm -rf /var/lib/apt/lists/*
40+
41+
COPY --from=deps /app/node_modules ./node_modules
42+
COPY --from=builder /app/dist ./dist
43+
COPY api/package.json ./
44+
45+
COPY api/AI/requirements.txt ./AI/requirements.txt
46+
RUN pip3 install --no-cache-dir --break-system-packages -r ./AI/requirements.txt
47+
48+
COPY api/AI ./AI
49+
50+
EXPOSE 5000
51+
52+
CMD ["node", "dist/server.js"]
53+

0 commit comments

Comments
 (0)