From 686a0573c47c24498a2ffb82897d1d9c68a70e03 Mon Sep 17 00:00:00 2001 From: Dustin Updyke Date: Fri, 6 Dec 2024 14:13:11 -0500 Subject: [PATCH] updates linux client docker maker --- src/Dockerfile-linux-client | 36 ++++++++++++++++++++ src/ghosts.client.linux/.dockerignore | 2 -- src/ghosts.client.linux/Dockerfile | 39 ---------------------- src/ghosts.client.linux/docker-compose.yml | 37 ++------------------ 4 files changed, 39 insertions(+), 75 deletions(-) create mode 100755 src/Dockerfile-linux-client delete mode 100755 src/ghosts.client.linux/.dockerignore delete mode 100755 src/ghosts.client.linux/Dockerfile diff --git a/src/Dockerfile-linux-client b/src/Dockerfile-linux-client new file mode 100755 index 00000000..c2244e35 --- /dev/null +++ b/src/Dockerfile-linux-client @@ -0,0 +1,36 @@ +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS dev + +# copy csproj and restore as distinct layers +COPY ghosts.client.linux/. /app/ +COPY Ghosts.Domain/. /app/Ghosts.Domain/ + +WORKDIR /app +RUN dotnet restore + +# copy everything else and build app +COPY ghosts.client.linux/ ./ghosts.client.linux/ +COPY Ghosts.Domain/ ./Ghosts.Domain/ +WORKDIR /app/ghosts.client.linux/ +RUN dotnet publish -c Release -o out + +FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine AS prod + +RUN apk add --no-cache \ + curl \ + nmap \ + busybox-extras \ + nikto \ + openssh-client \ + python3 && \ + wget 'https://github.com/sqlmapproject/sqlmap/tarball/master' -O sqlmap.tar.gz && \ + mkdir sqlmap && \ + tar -xvf sqlmap.tar.gz -C sqlmap && \ + rm sqlmap.tar.gz + +COPY --from=dev /app/ghosts.client.linux/out ./app +WORKDIR /app/ + +ENV ASPNETCORE_URLS=http://+:5000 +EXPOSE 5000/tcp + +CMD ["dotnet", "./ghosts.client.linux.dll"] \ No newline at end of file diff --git a/src/ghosts.client.linux/.dockerignore b/src/ghosts.client.linux/.dockerignore deleted file mode 100755 index eb9da8c7..00000000 --- a/src/ghosts.client.linux/.dockerignore +++ /dev/null @@ -1,2 +0,0 @@ -bin\ -obj\ \ No newline at end of file diff --git a/src/ghosts.client.linux/Dockerfile b/src/ghosts.client.linux/Dockerfile deleted file mode 100755 index 8223b552..00000000 --- a/src/ghosts.client.linux/Dockerfile +++ /dev/null @@ -1,39 +0,0 @@ -FROM mcr.microsoft.com/dotnet/sdk:6.0-alpine AS dev - -# copy csproj and restore as distinct layers -COPY ghosts.linux.sln ./app/ -COPY ghosts.client.linux/*csproj ./app/ghosts.client.linux/ -COPY Ghosts.Domain/*csproj ./app/Ghosts.Domain/ -COPY Ghosts.Domain/*.config ./app/Ghosts.Domain/ - -WORKDIR /app -RUN dotnet restore - -# copy everything else and build app -COPY ghosts.client.linux/ ./ghosts.client.linux/ -COPY Ghosts.Domain/ ./Ghosts.Domain/ -WORKDIR /app/ghosts.client.linux/ -RUN dotnet publish -c Release -o out - -FROM mcr.microsoft.com/dotnet/aspnet:6.0-alpine AS prod - -RUN apk add curl && \ - apk add nmap && \ - apk add busybox-extras && \ - apk add nikto && \ - apk add openssh-client && \ - apk add openssh-keygen && \ - apk add python && \ - wget 'https://github.com/sqlmapproject/sqlmap/tarball/master' --output-document=sqlmap.tar.gz && \ - mkdir sqlmap && \ - tar -xvf sqlmap.tar.gz -C sqlmap && \ - cd sqlmap/ -# python sqlmap.py --version - -COPY --from=dev /app/ghosts.client.linux/out ./app -WORKDIR /app/ - -ENV ASPNETCORE_URLS=http://+:5000 -EXPOSE 5000/tcp - -CMD ["dotnet", "./ghosts.client.linux.dll"] diff --git a/src/ghosts.client.linux/docker-compose.yml b/src/ghosts.client.linux/docker-compose.yml index 304ca2cc..d989e58a 100644 --- a/src/ghosts.client.linux/docker-compose.yml +++ b/src/ghosts.client.linux/docker-compose.yml @@ -1,38 +1,7 @@ -version: "3" services: - staypuft-011: - image: ghosts.client.alpine - container_name: aaa - build: - context: .. - dockerfile: ghosts.client.linux/dockerfile-alpine + ghosts-client: + image: dustinupdyke/ghosts-client-linux + container_name: ghosts-client-001 volumes: - ./config:/app/config - networks: - - custom_network - staypuft-1: - image: ghosts.client.alpine - container_name: staypuft-2 - volumes: - - ./config:/app/config - networks: - - custom_network - staypuft-2: - image: ghosts.client.alpine - container_name: staypuft-1 - volumes: - - ./config:/app/config - networks: - - custom_network - staypuft-3: - image: ghosts.client.alpine - container_name: staypuft-3 - volumes: - - ./config:/app/config - networks: - - custom_network -networks: - custom_network: - external: - name: ghostsapi_ghosts-network