Replace venv for docker container

This commit is contained in:
2026-02-15 23:08:13 -08:00
parent b82b1ef5be
commit 4537e810c9
25537 changed files with 14 additions and 10646477 deletions
+12 -15
View File
@@ -6,24 +6,16 @@ FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:9.0 AS build-Webserv
WORKDIR /WebServer
# Copy the csproj
COPY ./WebServer/Webserver.csproj ./
COPY ./WebServer/WebServer.csproj ./
# Restore the Server
RUN dotnet restore './Webserver.csproj'
RUN dotnet restore './WebServer.csproj'
# Copy the rest of the backend over
COPY ./WebServer/ ./
# Get the target arch
ARG TARGETARCH
COPY ./WebServer ./
# Build the source
RUN set -e && \
if [ "$TARGETARCH" = "arm64" ]; then RID="linux-arm64"; \
elif [ "$TARGETARCH" = "amd64" ]; then RID="linux-x64"; \
else echo "Unsupported ARCH: $TARGETARCH"; exit 1; \
fi && \
dotnet publish './Server.csproj' -c Release -r ${RID} -o /app/publish
RUN dotnet publish './WebServer.csproj' -c Release -o /app/publish
################
## Publish ##
@@ -32,7 +24,7 @@ RUN set -e && \
FROM mcr.microsoft.com/dotnet/aspnet:9.0
# Pull in required libraries to build python from source
RUN apt update && apt upgrade && apt install -y \
RUN apt update && apt upgrade -y && apt install -y \
build-essential \
zlib1g-dev \
libncurses5-dev \
@@ -52,11 +44,16 @@ RUN apt update && apt upgrade && apt install -y \
RUN wget https://www.python.org/ftp/python/3.11.0/Python-3.11.0.tgz && \
tar -xf Python-3.11.0.tgz && \
cd Python-3.11.0 && \
./configure --enable-optimizations && \
./configure --enable-optimizations --enable-shared && \
make -j$(nproc) && \
make altinstall && \
# Cleanup
cd .. && \
rm -rf Python-3.11.0.tgz Python-3.11.0 && \
# Tell the system where the new .so files are
echo "/usr/local/lib" > /etc/ld.so.conf.d/python311.conf && \
ldconfig && \
# Create symlinks
ln -s /usr/local/bin/python3.11 /usr/local/bin/python && \
ln -s /usr/local/bin/pip3.11 /usr/local/bin/pip
@@ -81,4 +78,4 @@ EXPOSE 5000
COPY --from=build-Webserver /app/publish ./
# Start the container
ENTRYPOINT ["dotnet", "MistoxWebsite.Server.dll", "--url", "http://localhost:5000"]
ENTRYPOINT ["dotnet", "WebServer.dll", "--url", "http://localhost:5000"]