sigyllly commited on
Commit
1d13f37
·
verified ·
1 Parent(s): cd28ddd

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -20
Dockerfile CHANGED
@@ -4,17 +4,19 @@ FROM python:3.10-slim
4
  # Set the working directory
5
  WORKDIR /app
6
 
7
- # Install dependencies: wget, apt-transport-https, gnupg2, .NET SDK, and Python pip
8
  RUN apt-get update && apt-get install -y \
9
  wget \
10
  apt-transport-https \
11
  gnupg2 \
12
- && wget https://packages.microsoft.com/config/debian/11/packages-microsoft-prod.deb -O packages-microsoft-prod.deb \
13
- && dpkg -i packages-microsoft-prod.deb \
14
- && apt-get update && apt-get install -y \
15
- dotnet-sdk-7.0 \
16
- python3-pip \
17
- && rm -rf /var/lib/apt/lists/*
 
 
18
 
19
  # Create a non-root user and set it as the user for the rest of the image
20
  RUN useradd -ms /bin/bash appuser
@@ -25,19 +27,6 @@ RUN chown -R appuser:appuser /app
25
  # Switch to the non-root user
26
  USER appuser
27
 
28
- # Create necessary directories and set permissions
29
- RUN mkdir -p /app/uploads /home/appuser/.mono && \
30
- chmod -R 777 /app/uploads /home/appuser/.mono
31
-
32
- # Set the MONO_HOME environment variable
33
- ENV MONO_HOME="/home/appuser/.mono"
34
-
35
- # Add the Mono tools directory to PATH
36
- ENV PATH="${PATH}:${MONO_HOME}/bin:/usr/bin"
37
-
38
- # Ensure mcs is in the PATH
39
- RUN echo $PATH && which mcs
40
-
41
  # Copy the requirements file with the correct owner
42
  COPY --chown=appuser:appuser ./requirements.txt /app/requirements.txt
43
 
 
4
  # Set the working directory
5
  WORKDIR /app
6
 
7
+ # Install dependencies: wget, apt-transport-https, gnupg2, Roslyn, and Python pip
8
  RUN apt-get update && apt-get install -y \
9
  wget \
10
  apt-transport-https \
11
  gnupg2 \
12
+ unzip \
13
+ && wget https://github.com/dotnet/roslyn/releases/download/v4.0.1/roslyn.zip \
14
+ && unzip roslyn.zip -d /usr/local/roslyn \
15
+ && apt-get install -y python3-pip \
16
+ && rm -rf /var/lib/apt/lists/* roslyn.zip
17
+
18
+ # Add Roslyn compiler (csc) to PATH
19
+ ENV PATH="/usr/local/roslyn/bin:${PATH}"
20
 
21
  # Create a non-root user and set it as the user for the rest of the image
22
  RUN useradd -ms /bin/bash appuser
 
27
  # Switch to the non-root user
28
  USER appuser
29
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  # Copy the requirements file with the correct owner
31
  COPY --chown=appuser:appuser ./requirements.txt /app/requirements.txt
32