This repository was archived by the owner on Oct 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 176
dockerization #62
Merged
Merged
dockerization #62
Changes from all commits
Commits
Show all changes
2 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 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,3 @@ | ||
.dockerignore | ||
SDK | ||
README.md |
This file contains 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,27 @@ | ||
FROM mono:5.12.0.226 AS webminerpool-build | ||
|
||
ARG DONATION_LEVEL=0.03 | ||
|
||
COPY server /server | ||
COPY hash_cn /hash_cn | ||
|
||
RUN sed -ri "s/^(.*DonationLevel = )[0-9]\.[0-9]{2}/\1${DONATION_LEVEL}/" /server/Server/DevDonation.cs && \ | ||
apt-get -qq update && \ | ||
apt-get -qq install build-essential && \ | ||
cd /hash_cn/libhash && \ | ||
make && \ | ||
cd /server && \ | ||
msbuild Server.sln /p:Configuration=Release_Server /p:Platform="any CPU" | ||
|
||
FROM mono:5.12.0.226 | ||
|
||
VOLUME ["/root"] | ||
|
||
RUN mkdir /webminerpool | ||
COPY entrypoint.sh /entrypoint.sh | ||
COPY --from=webminerpool-build /server/Server/bin/Release_Server/server.exe /webminerpool | ||
COPY --from=webminerpool-build /server/Server/bin/Release_Server/pools.json /webminerpool | ||
COPY --from=webminerpool-build /hash_cn/libhash/libhash.so /webminerpool | ||
RUN chmod +x /entrypoint.sh | ||
|
||
ENTRYPOINT ["./entrypoint.sh"] |
This file contains 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,33 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Check if $DOMAIN is set | ||
if [ -z $DOMAIN ]; then | ||
echo -e "You need to set \$DOMAIN variable at run time\n" | ||
echo -e "For example: docker run -d -p 80:80 -p 443:443 -e DOMAIN=example.com\n" | ||
exit 1 | ||
else | ||
# Install acme.sh | ||
apt-get -qq update | ||
apt-get install -qq \ | ||
cron \ | ||
openssl \ | ||
curl \ | ||
coreutils \ | ||
socat \ | ||
git | ||
git clone https://github.com/Neilpang/acme.sh.git /root/acme.sh && \ | ||
cd /root/acme.sh && \ | ||
git checkout 2.7.8 && \ | ||
/root/acme.sh/acme.sh --install | ||
|
||
# Generate SSL cert | ||
/root/.acme.sh/acme.sh --issue --standalone -d ${DOMAIN} -d www.${DOMAIN} | ||
|
||
# Generate pfx | ||
openssl pkcs12 -export -out /webminerpool/certificate.pfx -inkey /root/.acme.sh/${DOMAIN}/${DOMAIN}.key -in /root/.acme.sh/${DOMAIN}/${DOMAIN}.cer -certfile /root/.acme.sh/${DOMAIN}/fullchain.cer -passin pass:miner -passout pass:miner | ||
|
||
# Start server | ||
pushd /webminerpool | ||
exec /usr/bin/mono server.exe | ||
|
||
fi |
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.
please see comment here: https://github.com/notgiven688/webminerpool/pull/92/files#r259690063