-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (29 loc) · 954 Bytes
/
Dockerfile
File metadata and controls
38 lines (29 loc) · 954 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Build Stage
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
# Set the working directory for the build stage
WORKDIR /app
# Copy the project files and restore dependencies
COPY *.csproj ./
RUN dotnet restore
# Copy the remaining files and build the project
COPY . ./
RUN dotnet publish -c Release -o /app/out
# Runtime Stage
FROM ubuntu:22.04 AS runtime
# Install dependencies and utilities
RUN apt-get update && \
apt-get install -y \
libstdc++6 \
libc6 \
dotnet6 \
wget && \
apt-get clean && rm -rf /var/lib/apt/lists/*
# Set the working directory for the runtime stage
WORKDIR /app
# Copy the built application from the build stage
COPY --from=build /app/out .
# Copy any additional shared libraries required by the application
COPY --from=build /app/Dlls/libsharedModule.so .
COPY --from=build /app/move.sh .
# Keep the container running with a shell command
ENTRYPOINT ["/bin/sh", "-c", "while :; do sleep 10; done"]