-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
45 lines (37 loc) · 1.58 KB
/
Dockerfile
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
39
40
41
42
43
44
45
FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
####################################################################################
### Install OpenSSH and set the password for root to "Docker!"
####################################################################################
RUN apt-get update \
&& apt-get install -y openssh-server htop dos2unix \
&& echo "root:Docker!" | chpasswd
# Copy the sshd_config file to the /etc/ssh/ directory
COPY ssh/sshd_config /etc/ssh/
RUN dos2unix /etc/ssh/sshd_config
# Copy and configure the ssh_setup file
COPY ssh/ssh_setup.sh /tmp/ssh_setup.sh
RUN dos2unix /tmp/ssh_setup.sh \
&& chmod +x /tmp/ssh_setup.sh \
&& (sleep 1;/tmp/ssh_setup.sh 2>&1 > /dev/null)
EXPOSE 2222
####################################################################################
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
WORKDIR /src
COPY ["src/AksStartupDotnetApp/AksStartupDotnetApp.csproj", "AksStartupDotnetApp/"]
RUN dotnet restore "AksStartupDotnetApp/AksStartupDotnetApp.csproj"
COPY src/ .
WORKDIR "/src/AksStartupDotnetApp"
RUN dotnet build "AksStartupDotnetApp.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "AksStartupDotnetApp.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
# ENTRYPOINT ["dotnet", "AksStartupDotnetApp.dll"]
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
RUN dos2unix /usr/local/bin/docker-entrypoint.sh \
&& chmod +x /usr/local/bin/docker-entrypoint.sh
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]