-
Notifications
You must be signed in to change notification settings - Fork 2.7k
chore(dashboard): add dockerfile for separate deployment #2873
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
Tpuljak
wants to merge
4
commits into
main
Choose a base branch
from
dashboard-dockerfile
base: main
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
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
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
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 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 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 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 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,25 @@ | ||
| FROM node:20-alpine AS builder | ||
|
|
||
| RUN npm install -g corepack && corepack enable | ||
|
|
||
| WORKDIR /daytona | ||
|
|
||
| COPY . . | ||
|
|
||
| RUN yarn | ||
|
|
||
| RUN VITE_BASE_API_URL=%DAYTONA_BASE_API_URL% yarn nx build dashboard --configuration=production --nxBail=true | ||
|
|
||
| FROM nginx:alpine as dashboard | ||
|
|
||
| COPY --from=builder /daytona/dist/apps/dashboard /usr/share/nginx/html | ||
| COPY --from=builder /daytona/apps/dashboard/docker/nginx/default.conf /etc/nginx/conf.d/default.conf | ||
| COPY --from=builder /daytona/apps/dashboard/docker/entrypoint.sh /entrypoint.sh | ||
|
|
||
| ENV DAYTONA_BASE_API_URL="http://api:3000" | ||
|
|
||
| EXPOSE 80 | ||
|
|
||
| HEALTHCHECK CMD [ "wget", "-q", "--spider", "http://localhost/" ] | ||
|
|
||
| ENTRYPOINT ["/entrypoint.sh"] |
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,23 @@ | ||
| #!/bin/sh | ||
| # Copyright 2025 Daytona Platforms Inc. | ||
| # SPDX-License-Identifier: AGPL-3.0 | ||
|
|
||
| set -e | ||
|
|
||
| # Validate DAYTONA_BASE_API_URL is a well-formed URL | ||
| if ! echo "$DAYTONA_BASE_API_URL" | grep -Eq '^https?://[a-zA-Z0-9./?=_-]*$'; then | ||
| echo "Error: DAYTONA_BASE_API_URL is not a valid URL." | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Escape characters that could break sed replacement | ||
| escape_sed() { | ||
| printf '%s' "$1" | sed -e 's/[\/&|\\]/\\&/g' | ||
| } | ||
| DAYTONA_BASE_API_URL_ESCAPED=$(escape_sed "$DAYTONA_BASE_API_URL") | ||
|
|
||
| # Replace %DAYTONA_BASE_API_URL% with actual environment variable value | ||
| find /usr/share/nginx/html -type f \( -name "*.js" -o -name "*.html" \) -exec sed -i "s|%DAYTONA_BASE_API_URL%|${DAYTONA_BASE_API_URL_ESCAPED}|g" {} + | ||
|
|
||
| # Start nginx | ||
| exec nginx -g "daemon off;" |
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 @@ | ||
| server { | ||
| listen 80; | ||
| server_name localhost; | ||
| root /usr/share/nginx/html; | ||
| index index.html; | ||
| absolute_redirect off; | ||
|
|
||
| location = / { | ||
| return 301 /dashboard; | ||
| } | ||
|
|
||
| location /dashboard { | ||
| try_files $uri $uri/ /index.html; | ||
| } | ||
| } |
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 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
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.
Uh oh!
There was an error while loading. Please reload this page.