Openyx commited on
Commit
3af411d
·
verified ·
1 Parent(s): c35f228

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -12
Dockerfile CHANGED
@@ -6,10 +6,10 @@ ENV DEBIAN_FRONTEND=noninteractive \
6
  DOTNET_NUGET_SIGNATURE_VERIFICATION=false \
7
  NODE_OPTIONS="--max-old-space-size=4096"
8
 
9
- # 1. Install system packages + ClamAV
10
  RUN apt-get update && apt-get install -y \
11
  curl wget gnupg ca-certificates apt-transport-https \
12
- supervisor nginx unzip \
13
  clamav clamav-daemon clamav-freshclam \
14
  && rm -rf /var/lib/apt/lists/*
15
 
@@ -29,15 +29,16 @@ RUN wget https://releases.hashicorp.com/consul/1.8.0/consul_1.8.0_linux_amd64.zi
29
  && mv consul /usr/local/bin/ \
30
  && rm consul_1.8.0_linux_amd64.zip
31
 
32
- # 5. .NET 5 SDK (from archive)
33
- RUN wget https://dotnetcli.azureedge.net/dotnet/Sdk/5.0.408/dotnet-sdk-5.0.408-linux-x64.tar.gz \
 
34
  && mkdir -p /usr/share/dotnet \
35
- && tar -xzf dotnet-sdk-5.0.408-linux-x64.tar.gz -C /usr/share/dotnet \
36
  && ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet \
37
- && rm dotnet-sdk-5.0.408-linux-x64.tar.gz
38
  ENV DOTNET_ROOT=/usr/share/dotnet
39
 
40
- # 6. Node.js 16 (more stable for Nuxt 2)
41
  RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash - \
42
  && apt-get install -y nodejs \
43
  && rm -rf /var/lib/apt/lists/*
@@ -47,15 +48,15 @@ WORKDIR /app
47
  RUN git clone https://github.com/Chronoss3/MalwareMultiScan.git . \
48
  && echo "Repository cloned successfully"
49
 
50
- # 8. NuGet restore (separate step to see restore logs)
51
  RUN dotnet restore MalwareMultiScan.sln --disable-parallel \
52
  && echo "NuGet restore completed"
53
 
54
- # 9. Build .NET solution (with explicit output to diagnose failure)
55
  RUN dotnet build MalwareMultiScan.sln -c Release --no-restore -v minimal \
56
  || (echo "BUILD FAILED. See above." && exit 1)
57
 
58
- # 10. Build the Nuxt.js UI (separate step, with increased Node memory)
59
  WORKDIR /app/MalwareMultiScan.Ui
60
  RUN npm install --no-audit --no-fund --prefer-offline \
61
  && npm run build \
@@ -63,7 +64,7 @@ RUN npm install --no-audit --no-fund --prefer-offline \
63
  && cp -r dist/* /var/www/html/ \
64
  && echo "UI build completed"
65
 
66
- # 11. Configure nginx (port 7860 + API proxy)
67
  RUN echo 'server { \
68
  listen 7860; \
69
  server_name _; \
@@ -84,7 +85,7 @@ RUN echo 'server { \
84
  } \
85
  }' > /etc/nginx/sites-available/default
86
 
87
- # 12. Setup environment for API
88
  ENV MONGO_ADDRESS=localhost:27017 \
89
  REDIS_ADDRESS=localhost:6379 \
90
  CONSUL_ADDRESS=http://localhost:8500 \
 
6
  DOTNET_NUGET_SIGNATURE_VERIFICATION=false \
7
  NODE_OPTIONS="--max-old-space-size=4096"
8
 
9
+ # 1. System packages + git + ClamAV
10
  RUN apt-get update && apt-get install -y \
11
  curl wget gnupg ca-certificates apt-transport-https \
12
+ supervisor nginx unzip git \
13
  clamav clamav-daemon clamav-freshclam \
14
  && rm -rf /var/lib/apt/lists/*
15
 
 
29
  && mv consul /usr/local/bin/ \
30
  && rm consul_1.8.0_linux_amd64.zip
31
 
32
+ # 5. .NET 5 SDK (manual installation from archive)
33
+ ENV DOTNET_SDK_VERSION=5.0.408
34
+ RUN wget https://dotnetcli.azureedge.net/dotnet/Sdk/$DOTNET_SDK_VERSION/dotnet-sdk-$DOTNET_SDK_VERSION-linux-x64.tar.gz \
35
  && mkdir -p /usr/share/dotnet \
36
+ && tar -xzf dotnet-sdk-$DOTNET_SDK_VERSION-linux-x64.tar.gz -C /usr/share/dotnet \
37
  && ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet \
38
+ && rm dotnet-sdk-$DOTNET_SDK_VERSION-linux-x64.tar.gz
39
  ENV DOTNET_ROOT=/usr/share/dotnet
40
 
41
+ # 6. Node.js 16
42
  RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash - \
43
  && apt-get install -y nodejs \
44
  && rm -rf /var/lib/apt/lists/*
 
48
  RUN git clone https://github.com/Chronoss3/MalwareMultiScan.git . \
49
  && echo "Repository cloned successfully"
50
 
51
+ # 8. NuGet restore
52
  RUN dotnet restore MalwareMultiScan.sln --disable-parallel \
53
  && echo "NuGet restore completed"
54
 
55
+ # 9. Build .NET solution
56
  RUN dotnet build MalwareMultiScan.sln -c Release --no-restore -v minimal \
57
  || (echo "BUILD FAILED. See above." && exit 1)
58
 
59
+ # 10. Build the Nuxt.js UI
60
  WORKDIR /app/MalwareMultiScan.Ui
61
  RUN npm install --no-audit --no-fund --prefer-offline \
62
  && npm run build \
 
64
  && cp -r dist/* /var/www/html/ \
65
  && echo "UI build completed"
66
 
67
+ # 11. Nginx config (port 7860 + API proxy)
68
  RUN echo 'server { \
69
  listen 7860; \
70
  server_name _; \
 
85
  } \
86
  }' > /etc/nginx/sites-available/default
87
 
88
+ # 12. API environment
89
  ENV MONGO_ADDRESS=localhost:27017 \
90
  REDIS_ADDRESS=localhost:6379 \
91
  CONSUL_ADDRESS=http://localhost:8500 \