mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-04-18 16:03:36 +03:00
new: add Dockerfile and compose.yaml
This commit is contained in:
parent
9e44d49039
commit
d9eb9ff663
2 changed files with 40 additions and 0 deletions
17
Dockerfile
Normal file
17
Dockerfile
Normal file
|
@ -0,0 +1,17 @@
|
|||
FROM mcr.microsoft.com/dotnet/sdk:8.0@sha256:35792ea4ad1db051981f62b313f1be3b46b1f45cadbaa3c288cd0d3056eefb83 AS build-env
|
||||
WORKDIR /Octobot
|
||||
|
||||
# Copy everything
|
||||
COPY . ./
|
||||
# Restore as distinct layers
|
||||
RUN dotnet restore
|
||||
# Load build argument with publish options
|
||||
ARG PUBLISH_OPTIONS
|
||||
# Build and publish a release
|
||||
RUN dotnet publish ./TeamOctolings.Octobot.csproj $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"]
|
23
compose.yaml
Normal file
23
compose.yaml
Normal file
|
@ -0,0 +1,23 @@
|
|||
services:
|
||||
wireguard:
|
||||
container_name: wireguard
|
||||
image: jordanpotter/wireguard
|
||||
cap_add:
|
||||
- NET_ADMIN
|
||||
- SYS_MODULE
|
||||
sysctls:
|
||||
net.ipv4.conf.all.src_valid_mark: 1
|
||||
volumes:
|
||||
- /etc/wireguard/octobot.conf:/etc/wireguard/wg0.conf
|
||||
restart: unless-stopped
|
||||
|
||||
octobot:
|
||||
build:
|
||||
context: .
|
||||
args:
|
||||
- PUBLISH_OPTIONS
|
||||
environment:
|
||||
- BOT_TOKEN
|
||||
network_mode: service:wireguard
|
||||
depends_on:
|
||||
- wireguard
|
Loading…
Add table
Reference in a new issue