-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Dockerfile and compose.yaml (#335)
This PR adds Dockerfile, to run Octobot within a Docker container, and compose.yaml, to run the Octobot container along with any services that the user may require. --------- Signed-off-by: Octol1ttle <[email protected]> Signed-off-by: mctaylors <[email protected]> Co-authored-by: mctaylors <[email protected]>
- Loading branch information
1 parent
9e44d49
commit 9aa067e
Showing
4 changed files
with
64 additions
and
15 deletions.
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
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 |
---|---|---|
|
@@ -8,3 +8,4 @@ riderModule.iml | |
/.vs/ | ||
GuildData/ | ||
Logs/ | ||
compose.yaml |
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,16 @@ | ||
FROM mcr.microsoft.com/dotnet/sdk:8.0@sha256:35792ea4ad1db051981f62b313f1be3b46b1f45cadbaa3c288cd0d3056eefb83 AS build-env | ||
WORKDIR /Octobot | ||
|
||
# Copy everything | ||
COPY . ./ | ||
COPY .git/ ./.git/ | ||
# Load build argument with publish options | ||
ARG PUBLISH_OPTIONS="-c Release" | ||
# Build and publish a release | ||
RUN dotnet publish ./TeamOctolings.Octobot $PUBLISH_OPTIONS -o out | ||
|
||
# Build runtime image | ||
FROM mcr.microsoft.com/dotnet/runtime:8.0@sha256:a335dccd3231f7f9e2122691b21c634f96e187d3840c8b7dbad61ee09500e408 | ||
WORKDIR /Octobot | ||
COPY --from=build-env /Octobot/out . | ||
ENTRYPOINT ["./TeamOctolings.Octobot"] |
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,17 @@ | ||
services: | ||
octobot: | ||
container_name: octobot | ||
build: | ||
context: . | ||
args: | ||
- PUBLISH_OPTIONS | ||
environment: | ||
- BOT_TOKEN | ||
volumes: | ||
- guild-data:/Octobot/GuildData | ||
- logs:/Octobot/Logs | ||
restart: unless-stopped | ||
|
||
volumes: | ||
guild-data: | ||
logs: |