Skip to content

ci: socket realtime image for hosting#565

Merged
waleedlatif1 merged 4 commits intostagingfrom
ci/socket-image
Jun 27, 2025
Merged

ci: socket realtime image for hosting#565
waleedlatif1 merged 4 commits intostagingfrom
ci/socket-image

Conversation

@adiologydev
Copy link
Copy Markdown
Contributor

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.

Note: The image is highly unoptimized because it's all packaged within the same app in our mono-repo, this will gradually become a lot more lightweight once we properly utilise the mono-repo.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Security enhancement
  • Performance improvement
  • Code refactoring (no functional changes)

How Has This Been Tested?

Locally built and ran.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • All tests pass locally and in CI (bun run test)
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • I have updated version numbers as needed (if needed)
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Security Considerations:

  • My changes do not introduce any new security vulnerabilities
  • I have considered the security implications of my changes

Additional Information:

Any additional information, configuration or data that might be necessary to reproduce the issue or use the feature.

@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 27, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 27, 2025 3:59pm
sim ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 27, 2025 3:59pm

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

Added new realtime Socket.IO server infrastructure with Docker configuration for hosting. This introduces a critical service component for real-time functionality across the platform.

  • Added new matrix entry in .github/workflows/build.yml to build ghcr.io/simstudioai/realtime image
  • Created docker/realtime.Dockerfile with Bun runtime configuration for Socket.IO server on port 3002
  • Modified docker-compose.prod.yml to integrate realtime service with proper health checks and dependencies
  • Note: Current implementation bundles entire app due to mono-repo structure, pending future optimization

4 files reviewed, 2 comments
Edit PR Review Bot Settings | Greptile

Comment thread docker-compose.prod.yml
Comment thread docker/realtime.Dockerfile Outdated
Comment on lines +31 to +32
# Installing with full context to prevent missing dependencies error
RUN bun install --omit dev --ignore-scripts
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Second bun install is redundant since deps were already copied. Consider removing this step

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch

@delve-auditor
Copy link
Copy Markdown

delve-auditor Bot commented Jun 27, 2025

No security or compliance issues detected. Reviewed everything up to 841934c.

Security Overview
  • 🔎 Scanned files: 10 changed file(s)
Detected Code Changes
Change Type Relevant files
Configuration changes ► .devcontainer/Dockerfile
    Add new port exposure
► docker-compose.local.yml
    Add realtime server configuration
► docker-compose.prod.yml
    Add realtime server configuration
► .github/workflows/build.yml
    Add realtime Dockerfile to build matrix
Enhancement ► docker/realtime.Dockerfile
    Add new Dockerfile for realtime server
► package.json
    Add new development scripts
► apps/sim/package.json
    Update development scripts
► packages/cli/src/index.ts
    Add realtime server container support
► README.md
    Update development setup instructions

Reply to this PR with @delve-auditor followed by a description of what change you want and we'll auto-submit a change to this PR to implement it.

@waleedlatif1
Copy link
Copy Markdown
Collaborator

@adiologydev can we add any info to the README to let users know how to run the pkg. we also need to think about how we can modify the root package.json build command maybe like dev:full to run the socket server by default. not sure if there are best practices in place for sockets/external servers and how they should be ran

@adiologydev
Copy link
Copy Markdown
Contributor Author

adiologydev commented Jun 27, 2025

@adiologydev can we add any info to the README to let users know how to run the pkg. we also need to think about how we can modify the root package.json build command maybe like dev:full to run the socket server by default. not sure if there are best practices in place for sockets/external servers and how they should be ran

Sure, will add additional information about it in the readme.

It's not advisable in production to use concurrently. Also the way we build the app (standalone), we can't really package anything else together in that image.

@waleedlatif1 waleedlatif1 merged commit 00334e5 into staging Jun 27, 2025
4 checks passed
@waleedlatif1 waleedlatif1 deleted the ci/socket-image branch June 28, 2025 04:46
arenadeveloper02 pushed a commit to arenadeveloper02/p2-sim that referenced this pull request Sep 19, 2025
* feat: socket server for self/local deployment

* ci: memory limit and redundant dependency install

* chore: update readme, devcontainer, cli package

* chore: add new dev scripts and update README for full development setup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants