-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
48 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,39 @@ | ||
# Use the official .NET SDK image to build the application | ||
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-env | ||
WORKDIR /app | ||
ARG COMMIT | ||
|
||
COPY ./libplanet/src/Libplanet/Libplanet.csproj ./Libplanet/ | ||
COPY ./libplanet/src/Libplanet.RocksDBStore/Libplanet.RocksDBStore.csproj ./Libplanet.RocksDBStore/ | ||
COPY ./NineChronicles.Snapshot/NineChronicles.Snapshot.csproj ./NineChronicles.Snapshot/ | ||
# Copy the entire project directories | ||
COPY ./libplanet/src/Libplanet ./Libplanet | ||
COPY ./libplanet/src/Libplanet.RocksDBStore ./Libplanet.RocksDBStore | ||
COPY ./NineChronicles.Snapshot ./NineChronicles.Snapshot | ||
|
||
# Restore all projects at once | ||
# Restore dependencies for each project | ||
RUN dotnet restore ./Libplanet/Libplanet.csproj | ||
RUN dotnet restore ./Libplanet.RocksDBStore/Libplanet.RocksDBStore.csproj | ||
RUN dotnet restore ./NineChronicles.Snapshot/NineChronicles.Snapshot.csproj | ||
|
||
# Copy everything else and build | ||
# Copy the rest of the files and publish the application | ||
COPY . ./ | ||
RUN dotnet publish NineChronicles.Snapshot/NineChronicles.Snapshot.csproj \ | ||
RUN dotnet publish ./NineChronicles.Snapshot/NineChronicles.Snapshot.csproj \ | ||
-c Release \ | ||
-r linux-x64 \ | ||
-o out \ | ||
--self-contained \ | ||
--version-suffix $COMMIT | ||
|
||
# Build runtime image | ||
# Build the runtime image | ||
FROM mcr.microsoft.com/dotnet/aspnet:6.0 | ||
WORKDIR /app | ||
RUN apt-get update && apt-get install -y libc6-dev | ||
|
||
# Install necessary dependencies | ||
RUN apt-get update && apt-get install -y --no-install-recommends libc6-dev && apt-get clean && rm -rf /var/lib/apt/lists/* | ||
|
||
# Copy the published application from the build environment | ||
COPY --from=build-env /app/out . | ||
|
||
# Define the volume for persistent data storage | ||
VOLUME /data | ||
|
||
# Set the entry point to run the application | ||
ENTRYPOINT ["dotnet", "NineChronicles.Snapshot.dll"] |
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 |
---|---|---|
@@ -1,31 +1,39 @@ | ||
# Use the official .NET SDK image to build the application | ||
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-env | ||
WORKDIR /app | ||
ARG COMMIT | ||
|
||
COPY ./libplanet/src/Libplanet/Libplanet.csproj ./Libplanet/ | ||
COPY ./libplanet/src/Libplanet.RocksDBStore/Libplanet.RocksDBStore.csproj ./Libplanet.RocksDBStore/ | ||
COPY ./NineChronicles.Snapshot/NineChronicles.Snapshot.csproj ./NineChronicles.Snapshot/ | ||
# Copy the entire project directories | ||
COPY ./libplanet/src/Libplanet ./Libplanet | ||
COPY ./libplanet/src/Libplanet.RocksDBStore ./Libplanet.RocksDBStore | ||
COPY ./NineChronicles.Snapshot ./NineChronicles.Snapshot | ||
|
||
# Restore all projects at once | ||
# Restore dependencies for each project | ||
RUN dotnet restore ./Libplanet/Libplanet.csproj | ||
RUN dotnet restore ./Libplanet.RocksDBStore/Libplanet.RocksDBStore.csproj | ||
RUN dotnet restore ./NineChronicles.Snapshot/NineChronicles.Snapshot.csproj | ||
|
||
# Copy everything else and build | ||
# Copy the rest of the files and publish the application | ||
COPY . ./ | ||
RUN dotnet publish NineChronicles.Snapshot/NineChronicles.Snapshot.csproj \ | ||
RUN dotnet publish ./NineChronicles.Snapshot/NineChronicles.Snapshot.csproj \ | ||
-c Release \ | ||
-r linux-x64 \ | ||
-o out \ | ||
--self-contained \ | ||
--version-suffix $COMMIT | ||
|
||
# Build runtime image | ||
# Build the runtime image | ||
FROM mcr.microsoft.com/dotnet/aspnet:6.0 | ||
WORKDIR /app | ||
RUN apt-get update && apt-get install -y libc6-dev | ||
|
||
# Install necessary dependencies | ||
RUN apt-get update && apt-get install -y --no-install-recommends libc6-dev && apt-get clean && rm -rf /var/lib/apt/lists/* | ||
|
||
# Copy the published application from the build environment | ||
COPY --from=build-env /app/out . | ||
|
||
# Define the volume for persistent data storage | ||
VOLUME /data | ||
|
||
# Set the entry point to run the application | ||
ENTRYPOINT ["dotnet", "NineChronicles.Snapshot.dll"] |
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 |
---|---|---|
@@ -1,31 +1,39 @@ | ||
# Use the official .NET SDK image to build the application | ||
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-env | ||
WORKDIR /app | ||
ARG COMMIT | ||
|
||
COPY ./libplanet/src/Libplanet/Libplanet.csproj ./Libplanet/ | ||
COPY ./libplanet/src/Libplanet.RocksDBStore/Libplanet.RocksDBStore.csproj ./Libplanet.RocksDBStore/ | ||
COPY ./NineChronicles.Snapshot/NineChronicles.Snapshot.csproj ./NineChronicles.Snapshot/ | ||
# Copy the entire project directories | ||
COPY ./libplanet/src/Libplanet ./Libplanet | ||
COPY ./libplanet/src/Libplanet.RocksDBStore ./Libplanet.RocksDBStore | ||
COPY ./NineChronicles.Snapshot ./NineChronicles.Snapshot | ||
|
||
# Restore all projects at once | ||
# Restore dependencies for each project | ||
RUN dotnet restore ./Libplanet/Libplanet.csproj | ||
RUN dotnet restore ./Libplanet.RocksDBStore/Libplanet.RocksDBStore.csproj | ||
RUN dotnet restore ./NineChronicles.Snapshot/NineChronicles.Snapshot.csproj | ||
|
||
# Copy everything else and build | ||
# Copy the rest of the files and publish the application | ||
COPY . ./ | ||
RUN dotnet publish NineChronicles.Snapshot/NineChronicles.Snapshot.csproj \ | ||
RUN dotnet publish ./NineChronicles.Snapshot/NineChronicles.Snapshot.csproj \ | ||
-c Release \ | ||
-r linux-arm64 \ | ||
-o out \ | ||
--self-contained \ | ||
--version-suffix $COMMIT | ||
|
||
# Build runtime image | ||
# Build the runtime image | ||
FROM --platform=linux/arm64 mcr.microsoft.com/dotnet/aspnet:6.0-bullseye-slim-arm64v8 | ||
WORKDIR /app | ||
RUN apt-get update && apt-get install -y libc6-dev | ||
|
||
# Install necessary dependencies | ||
RUN apt-get update && apt-get install -y --no-install-recommends libc6-dev && apt-get clean && rm -rf /var/lib/apt/lists/* | ||
|
||
# Copy the published application from the build environment | ||
COPY --from=build-env /app/out . | ||
|
||
# Define the volume for persistent data storage | ||
VOLUME /data | ||
|
||
# Set the entry point to run the application | ||
ENTRYPOINT ["dotnet", "NineChronicles.Snapshot.dll"] |