-
Notifications
You must be signed in to change notification settings - Fork 4
docker dev env setup #1663
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Oksamies
wants to merge
1
commit into
master
Choose a base branch
from
12-10-docker_dev_env_setup
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
docker dev env setup #1663
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| FROM node:24-bookworm | ||
|
|
||
| # Install system dependencies | ||
| RUN apt-get update \ | ||
| && apt-get install -y --no-install-recommends iptables socat \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| WORKDIR /workspace | ||
|
|
||
| # Copy entrypoint script | ||
| COPY apps/cyberstorm-remix/entrypoint.dev.sh /usr/local/bin/entrypoint.sh | ||
| RUN chmod +x /usr/local/bin/entrypoint.sh | ||
|
|
||
| ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] | ||
| CMD ["yarn", "workspace", "@thunderstore/cyberstorm-remix", "dev", "--port", "3000", "--host", "0.0.0.0"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,68 +1,44 @@ | ||
| # How to setup and run Nimbus dev environment with local Thunderstore | ||
|
|
||
| ## Preparations | ||
| This quide expects you to have setup your Thunderstore Django project for development on some level. Please setup the Thunderstore project before continuing. | ||
|
|
||
| ## Setup nginx proxy for local data ingress/egress | ||
| 1. Add the following to your hosts (on windows, google what how to achive same on other OS') | ||
| ``` | ||
| 127.0.0.1 thunderstore.temp | ||
| 127.0.0.1 new.thunderstore.temp | ||
| ``` | ||
|
|
||
| 2. Boot up the nginx proxy with the following command; `docker compose -f tools/ts-dev-proxy/docker-compose.yml up` | ||
|
|
||
| 3. Boot up your Thunderstore backend and ensure it's running in port 81 (it's normally 80). The following [line](https://github.com/thunderstore-io/Thunderstore/blob/f06b9b438ea6e990881e60339d34bde1a480d073/docker-compose.yml#L123) in your Thunderstore projects docker-compose, should be `- "127.0.0.1:81:8000"` | ||
|
|
||
| ## Setup Nimbus for development | ||
|
|
||
| 1. Clone the repo `git@github.com:thunderstore-io/thunderstore-ui.git` | ||
|
|
||
| 2. Setup FontAwesome token. One way to do it is to add a `.npmrc` file with the following contents, under `thunderstore-ui/build-secrets/.npmrc` | ||
| ``` | ||
| @fortawesome:registry = "https://npm.fontawesome.com/" | ||
| //npm.fontawesome.com/:_authToken = YOUR_FA_TOKEN | ||
| ``` | ||
|
|
||
| 3. Run `yarn install` first on the repo root (`thunderstore-ui` folder) and then again in the `thunderstore-ui/apps/cyberstorm-remix` folder. | ||
|
|
||
| 4. Add `.env.development` and/or `.env.production` files. You can copy the `.env` file, rename and edit the values to your needs. Here's a example of the file contents: | ||
| ``` | ||
| VITE_SITE_URL=http://thunderstore.temp | ||
| VITE_BETA_SITE_URL=http://new.thunderstore.temp | ||
| VITE_API_URL=http://thunderstore.temp | ||
| VITE_COOKIE_DOMAIN=.thunderstore.temp | ||
| VITE_AUTH_BASE_URL=http://thunderstore.temp | ||
| VITE_AUTH_RETURN_URL=http://new.thunderstore.temp | ||
| __VITE_ADDITIONAL_SERVER_ALLOWED_HOSTS=.thunderstore.temp | ||
| ``` | ||
|
|
||
| 5. Run the build/start server script or the dev server script | ||
|
|
||
| Build and start | ||
| ``` | ||
| yarn workspace @thunderstore/cyberstorm-remix build | ||
| yarn workspace @thunderstore/cyberstorm-remix start --port 3000 --host 0.0.0.0 | ||
| ``` | ||
|
|
||
| Dev script | ||
| ``` | ||
| yarn workspace @thunderstore/cyberstorm-remix dev --port 3000 --host 0.0.0.0 | ||
| ``` | ||
|
|
||
| ## Finally | ||
| You should now have the fully local Nimbus dev environment setup and running in `http://new.thunderstore.temp` and the Django site should be running in `http://thunderstore.temp`. You might need to go to `http://new.thunderstore.temp/communities` as Nimbus doesn't have a landing page yet. | ||
|
|
||
| # How to setup ts-proxy as a backend for this project | ||
| **Keep in mind that when using the ts-proxy, the sessions and actions will be made against the actual production Thunderstore** | ||
|
|
||
| 1. Open hosts file as administrator (`C:\Windows\System32\drivers\etc`) and add this `127.0.0.1 thunderstore.temp` there | ||
| 2. Download and install Docker and docker-compose. For windows people, Docker for Windows should be enough. | ||
| 3. Open up a terminal and navigate to `thunderstore-ui/tools/ts-proxy` | ||
| 4. Run `docker compose up` | ||
| 5. Add these to your `.env.development` or `.env.production` | ||
| ``` | ||
| PUBLIC_SITE_URL=http://thunderstore.temp | ||
| PUBLIC_API_URL=http://thunderstore.temp:81 | ||
| ``` | ||
| 6. Run the Nimbus project normally | ||
| # Cyberstorm Remix (Nimbus) | ||
|
|
||
| This is the Remix application that powers the new Thunderstore frontend (codenamed Nimbus). | ||
|
|
||
| ## Quick Start (Docker) | ||
|
|
||
| The easiest way to run the full stack (Backend + Frontend) is using Docker. | ||
|
|
||
| 1. **Clone Repositories** | ||
| Ensure you have both `Thunderstore` (Backend) and `thunderstore-ui` (Frontend) cloned side-by-side. | ||
| ```bash | ||
| # Example structure | ||
| # C:\projects\Thunderstore | ||
| # C:\projects\thunderstore-ui | ||
| ``` | ||
|
|
||
| 2. **Start Backend** | ||
| ```bash | ||
| cd ../Thunderstore | ||
| docker compose up -d | ||
| docker compose exec django python manage.py migrate | ||
| docker compose exec django python manage.py setup_dev_env | ||
| ``` | ||
|
|
||
| 3. **Start Frontend** | ||
| ```bash | ||
| cd ../thunderstore-ui | ||
| docker compose -f apps/cyberstorm-remix/docker-compose.dev.yml up -d | ||
| ``` | ||
|
|
||
| 4. **Open Browser** | ||
| - **Frontend**: [http://new.localhost](http://new.localhost) | ||
| - **Backend**: [http://localhost](http://localhost) | ||
|
|
||
| ## Manual Setup | ||
|
|
||
| If you prefer running Node locally instead of in Docker: | ||
|
|
||
| 1. **Install Dependencies**: `yarn install` (in repo root) | ||
| 2. **Configure Env**: Copy `.env.example` to `.env` in `apps/cyberstorm-remix`. | ||
| 3. **Run Dev Server**: | ||
| ```bash | ||
| yarn workspace @thunderstore/cyberstorm-remix dev | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -23,6 +23,7 @@ export function RouteErrorBoundary() { | |||
| if (error && import.meta.env.PROD) { | ||||
| captureRemixErrorBoundaryError(error); | ||||
| } else if (error) { | ||||
| console.log("Error boundary caught error", error); | ||||
|
||||
| console.log("Error boundary caught error", error); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation states "Read the Setup Guide to get started with the full stack (Frontend + Backend)" but the referenced README only covers Docker setup. Consider adding information about the manual setup prerequisites, such as installing Node.js/Yarn, or clarifying that the manual setup section only covers the frontend portion.