Skip to content

Commit

Permalink
refactor: setup and deploy to FLY gpu
Browse files Browse the repository at this point in the history
  • Loading branch information
cs50victor committed Feb 21, 2024
1 parent 9ffc2c1 commit 1d7e314
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion demo/components/WebSocketExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ export interface ServerWSResponse {
}

export default function WebSocketExample({port = 8080}:{port?:number}){
const server_ws_url = process.env.NODE_ENV === "production" ? `ws://localhost:${port}` : "ws://new-media.fly.dev"
const [imgMetadata, setImageMetadata] = useState<ServerWSResponse>();
const [socket, setSocket] = useState<WebSocket>()

useEffect(() => {
const socket = new WebSocket(`ws://localhost:${port}`)
const socket = new WebSocket(server_ws_url)

socket.onopen = () => {
setSocket(socket)
Expand Down
6 changes: 3 additions & 3 deletions fly.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
app = 'new-media-still-surf-1038'
primary_region = 'sjc'
app = 'new-media'
primary_region = 'ord'

[build]
dockerfile = 'Dockerfile.prod'
Expand All @@ -16,4 +16,4 @@ primary_region = 'sjc'
cpu_kind = 'performance'
memory = '64gb'
cpus = 16
size = "a100-40gb"
size = "a100-40gb"

0 comments on commit 1d7e314

Please sign in to comment.