-
-
Notifications
You must be signed in to change notification settings - Fork 68
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
Fix docker build script #213
base: main
Are you sure you want to change the base?
Conversation
Thank you @Deliay. A rather large refactor is under way on the Thanks for the work on the docker script, I haven't really maintained it at all. I appreciate the contribution. |
Update: PR #211 is merged into main. I will be reviewing the changes here soon to see how it needs to change |
@@ -1,5 +1,5 @@ | |||
{ | |||
"Urls": "http://localhost:57940", | |||
"Urls": "http://0.0.0.0:57940", |
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.
Binding to 0.0.0.0
here is a security risk if the machine running NetPad is exposed to an untrusted network. Instead we can have the docker script create an appsettings.Local.json
that overrides that setting and sets it to 0.0.0.0
. NetPad will use a appsettings.Local.json
file if one exists.
@@ -1,5 +1,5 @@ | |||
{ | |||
"Urls": "http://localhost:57930", | |||
"Urls": "http://0.0.0.0:57930", |
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.
Same as above
README.md
Outdated
FROM netpad | ||
RUN apk add dotnet6-sdk | ||
RUN wget .... | bash -c | ||
RUN ... |
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.
Lines 284
and 285
seem incomplete (ie. ...
)?
<Exec WorkingDirectory="$(SpaRoot)" Command="npm run build" /> | ||
<Exec WorkingDirectory="$(SpaRoot)" Command="npm run build:ssr -- --prod" Condition=" '$(BuildServerSideRenderer)' == 'true' " /> | ||
<Exec WorkingDirectory="$(SpaRoot)" Command="npm install" Condition="'$(SKIP_SPA_BUILD)' != 'true' "/> | ||
<Exec WorkingDirectory="$(SpaRoot)" Command="npm run build" Condition=" '$(SKIP_SPA_BUILD)' != 'true' And '$(TARGET)' != 'web' " /> |
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.
Why do we not want this when TARGET
is web
?
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 frontend project has been built ahead in docker script, so we need to skip it when running the MSBuild target.
|
||
if (!string.IsNullOrWhiteSpace(additionalArgs)) | ||
args += " " + additionalArgs; | ||
var args = $"{additionalArgs} {projectArgs}"; |
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 new change removes the ""
wrapping the project path that is still needed.
@Deliay I requested some changes before merging the PR. In addition let's hold off on commit (Bump .NET to 8 and bump dependencies to latest version). The package upgrade has a little more to it, especially related to the swagger generated API client. For .NET 8 I want to run some tests on my end to make sure everything still works with that upgrade so I'll go ahead and update to .NET 8 in a later PR once I've validated it. Can you also revert the change to v8 in the README introduced in Lastly, the change that you introduced in (Support lanuch OmniSharp server via 'dotnet exec OmniSharp.dll') did you test this still works when running the app without docker? Really appreciate your contribution! |
@tareqimbasher would you be interested in another pr mainly for fixing the docker file? I have a a working dockerfile on my pc that uses a multistage build. |
@Jogai yes I would be interested. Thanks for the contribution! |
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.
I haven't dealt with this pull request for a long time due to being busy with my daily life chores. There have been a lot of new changes over this long period of time, so I'll rebase entire branch to latest commit and fix issues in the review.
<Exec WorkingDirectory="$(SpaRoot)" Command="npm run build" /> | ||
<Exec WorkingDirectory="$(SpaRoot)" Command="npm run build:ssr -- --prod" Condition=" '$(BuildServerSideRenderer)' == 'true' " /> | ||
<Exec WorkingDirectory="$(SpaRoot)" Command="npm install" Condition="'$(SKIP_SPA_BUILD)' != 'true' "/> | ||
<Exec WorkingDirectory="$(SpaRoot)" Command="npm run build" Condition=" '$(SKIP_SPA_BUILD)' != 'true' And '$(TARGET)' != 'web' " /> |
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 frontend project has been built ahead in docker script, so we need to skip it when running the MSBuild target.
I tried to build a Docker image of NetPad, but it failed. I fixed the Dockerfile and then incidentally upgraded .NET to 8.0 and also upgraded most of the NetPad dependencies to the latest version.
This pull request includes these changes:
dotnet exec OmniSharp.dll
due to the container limitation