Skip to content

Commit

Permalink
Fix dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
arjunkomath committed Jan 21, 2025
1 parent 248fd82 commit ec8905f
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 269 deletions.
6 changes: 1 addition & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,10 @@ ENV NEXT_TELEMETRY_DISABLED=1
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs

COPY --from=builder /app/public ./public

COPY --from=builder --chown=nextjs:nodejs /app/public ./public
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static

# Custom server
COPY --from=builder --chown=nextjs:nodejs /app/server.js ./server.js

USER nextjs
EXPOSE 3000
ENV PORT=3000
Expand Down
5 changes: 0 additions & 5 deletions app/socket.ts

This file was deleted.

31 changes: 0 additions & 31 deletions components/console/notifications.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"use client";

import { getUserNotifications } from "@/app/(dashboard)/[tenant]/settings/actions";
import { socket } from "@/app/socket";
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
import {
Expand Down Expand Up @@ -58,36 +57,6 @@ function Notifications({ userId }: { userId: string }) {
getUserNotifications().then(setNotifications);
}, []);

useEffect(() => {
if (socket.connected) {
onConnect();
}

function onConnect() {
console.log("WS: Connected to server");
if (userId) {
console.log("WS: Joining user", userId);
socket.emit("join", userId);
}
}

function onDisconnect() {
console.log("WS: Disconnected from server");
}

socket.on("connect", onConnect);
socket.on("disconnect", onDisconnect);

socket.on("message", (msg) => {
console.log("WS: Message received", msg);
});

return () => {
socket.off("connect", onConnect);
socket.off("disconnect", onDisconnect);
};
}, [userId]);

return (
<Popover onOpenChange={fetchNotifications}>
<PopoverTrigger asChild>
Expand Down
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "TZ=UTC node server.js",
"dev": "TZ=UTC next dev",
"build": "next build",
"start": "NODE_ENV=production node server.js",
"start": "next start",
"lint": "biome lint",
"generate:migrations": "drizzle-kit generate"
},
Expand Down Expand Up @@ -57,8 +57,6 @@
"remark-gfm": "^4.0.0",
"rrule": "^2.8.1",
"sharp": "^0.33.4",
"socket.io": "^4.8.1",
"socket.io-client": "^4.8.1",
"strip-markdown": "^6.0.0",
"tailwind-merge": "^1.13.2",
"tailwindcss": "3.3.2",
Expand Down
Loading

0 comments on commit ec8905f

Please sign in to comment.