Skip to content

Commit 4b60635

Browse files
committed
feat: added docker images
1 parent 1d287ba commit 4b60635

File tree

29 files changed

+235
-1782
lines changed

29 files changed

+235
-1782
lines changed

Makefile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
up:
2+
docker compose up -d
3+
4+
down:
5+
docker compose down -v
6+
7+
delete:
8+
docker compose down -v --rmi all
9+
10+
build:
11+
docker compose build --no-cache
12+
13+
delPm2:
14+
pm2 delete deployt-docker-orch
15+
16+
pm2Logs:
17+
pm2 logs deployt-docker-orch
18+
19+
startPm2:
20+
cd docker-orch && pm2 start npm --name "deployt-docker-orch" -- start
21+
22+
start:
23+
make delPm2 && \
24+
cd docker-builder && make build && \
25+
cd .. && make startPm2 \
26+
cd .. && docker compose up -d
27+
28+
stop:
29+
make down && \
30+
pm2 stop deployt-docker-orch

core/.dockerignore

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Node modules
2+
node_modules
3+
4+
# Next.js build output
5+
.next
6+
7+
# Logs
8+
*.log
9+
npm-debug.log*
10+
11+
# Editor directories and files
12+
.vscode
13+
.idea
14+
*.swp
15+
*.swo
16+
17+
# OS generated files
18+
.DS_Store
19+
Thumbs.db
20+
21+
# Test coverage
22+
coverage
23+
24+
# Temporary files
25+
*.tmp
26+
*.temp
27+
28+
# Prisma
29+
prisma/*.db
30+
31+
# Debug files
32+
npm-debug.log*
33+
yarn-debug.log*
34+
yarn-error.log*
35+
36+
# Build files
37+
out
38+
39+
# Misc
40+
README.md

core/Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM node:18-alpine
2+
3+
WORKDIR /app
4+
5+
COPY package*.json ./
6+
7+
RUN npm ci
8+
9+
COPY prisma ./prisma
10+
11+
RUN npx prisma generate
12+
13+
COPY . .
14+
15+
RUN npm run build
16+
17+
EXPOSE 3000
18+
19+
CMD ["npm", "start"]

core/components/Dashboard/Project.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,14 @@ import ProjectStatus from "@/components/ProjectDetails/ProjectStatus";
2323

2424
export function Project({
2525
project,
26+
isExpanded,
2627
}: {
2728
project: Awaited<ReturnType<typeof getProjects>>[0];
29+
isExpanded?: boolean;
2830
}) {
2931
const { toast } = useToast();
3032

31-
const projectUrl = `${project.slug}.${NEXT_PUBLIC_WEB_SERVER}`;
33+
const projectUrl = `https://${project.slug}.${NEXT_PUBLIC_WEB_SERVER}`;
3234
const copyToClipboard = (text: string) => {
3335
navigator.clipboard.writeText(text);
3436
toast({
@@ -38,7 +40,11 @@ export function Project({
3840
};
3941

4042
return (
41-
<Card className="flex w-full max-w-md flex-col space-y-3 shadow-md">
43+
<Card
44+
className={`flex w-full ${
45+
isExpanded ? "" : "max-w-md"
46+
} flex-col space-y-3 shadow-md`}
47+
>
4248
<CardHeader className="flex flex-row items-center justify-between pb-2">
4349
<div className="flex items-center space-x-2">
4450
<CardTitle className="text-xl font-semibold">

core/components/Dashboard/Projects.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,11 @@ export default function DashboardClient({
157157
className={`grid gap-6 ${viewMode === VIEW_MODE.grid ? "grid-cols-1 sm:grid-cols-2 lg:grid-cols-3" : "grid-cols-1"}`}
158158
>
159159
{filteredAndSortedProjects.map((project) => (
160-
<Project key={project.id} project={project} />
160+
<Project
161+
key={project.id}
162+
project={project}
163+
isExpanded={viewMode === VIEW_MODE.list}
164+
/>
161165
))}
162166
</div>
163167
)}

core/components/ProjectDetails/DeleteButton.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,8 @@ export default function DeleteProject({ project }: { project: ProjectType }) {
2727

2828
const handleDelete = async () => {
2929
if (
30-
true
31-
// projectName === project.name &&
32-
// deleteKeyword.toLowerCase() === "delete"
30+
projectName === project.name &&
31+
deleteKeyword.toLowerCase() === "delete"
3332
) {
3433
try {
3534
setLoading(true);
@@ -92,10 +91,10 @@ export default function DeleteProject({ project }: { project: ProjectType }) {
9291
<Button
9392
variant="destructive"
9493
onClick={handleDelete}
95-
// disabled={
96-
// projectName !== project.name ||
97-
// deleteKeyword.toLowerCase() !== "delete"
98-
// }
94+
disabled={
95+
projectName !== project.name ||
96+
deleteKeyword.toLowerCase() !== "delete"
97+
}
9998
className="w-32"
10099
>
101100
{loading ? (

core/components/ProjectDetails/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export default function ProjectDetails({
5757
</CardHeader>
5858
<CardContent>
5959
<Link
60-
href={`${project.slug}.${NEXT_PUBLIC_WEB_SERVER}`}
60+
href={`https://${project.slug}.${NEXT_PUBLIC_WEB_SERVER}`}
6161
target="_blank"
6262
>
6363
<Button className="mb-2 w-full">View Project</Button>

core/lib/envVars.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
export const NEXT_PUBLIC_WEB_SERVER = process.env.NEXT_PUBLIC_WEB_SERVER;
2+
3+
console.log(NEXT_PUBLIC_WEB_SERVER);

docker-builder/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
IMAGE_NAME=pulkitxm/vercel-builder-test
1+
IMAGE_NAME=pulkitxm/deployit-builder
22
CONTAINER_NAME=test-vercel-builder
33
DOCKERFILE_PATH=Dockerfile
44
ENV_FILE=.env

docker-builder/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "docker-builder",
2+
"name": "deployit-docker-builder",
33
"version": "1.0.0",
44
"main": "index.js",
55
"scripts": {

0 commit comments

Comments
 (0)