-
Notifications
You must be signed in to change notification settings - Fork 2
Add basic Dockerfile to build image #58
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
base: main
Are you sure you want to change the base?
Conversation
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.
@evolvingpixie thank you so much! I left a few questions / comments
@@ -0,0 +1 @@ | |||
**/appsettings.Development.json |
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.
does it also include the stuff in .gitignore?
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.
Don't think it does. Should copy the same things to this file.
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 don't think it needs the whole gitignore, but it should exclude appsettings.Local.json
.
key=$(echo "${item}" | cut -d "=" -f 1) | ||
value=$(echo "${item}" | cut -d "=" -f 2-) | ||
jq $key="\"$value\"" appsettings.json > $tmpfile && \ | ||
mv $tmpfile appsettings.json |
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.
appsettings.json
should not be modified, as it's meant to be a template of default values. Instead, user settings / overrides should go in appsettings.Production.json
. The application will overlay the configurations, with Production getting priority.
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.
Noted. WIll fix.
jq $key="\"$value\"" appsettings.json > $tmpfile && \ | ||
mv $tmpfile appsettings.json | ||
done | ||
exec $@ |
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.
Make sure to set DOTNET_ENVIRONMENT=Production
before running
|
||
# Add modshark user and copy built modshark | ||
RUN useradd -m -s /bin/bash modshark | ||
COPY --from=builder --chown=modshark:modshark /ModShark/ModShark/bin/Release/net8.0/publish/ /ModShark |
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.
If it helps, there's now a /Resources/build-prod.ps1
script that runs a build and stages all the compiled output in a predictable /Publish
directory. You can copy the whole thing as-is or just take parts.
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.
Awesome. Will try to take a look and possibly use that.
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.
ModShark requires database migrations upon installation and then with each update. They're meant to be run manually by a DBA / admin, but they could be bundled and run on startup.
Super basic and barely tested container build for ModShark. Can be used with a github action to build and publish.