demo-docker-gradio / Dockerfile
sigyllly's picture
Update Dockerfile
14cd36c verified
raw
history blame
739 Bytes
# Use the .NET 6 SDK image
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-env
# Set the working directory
WORKDIR /app
# Install necessary dependencies
RUN apt-get update && apt-get install -y wget
# Copy project files
COPY . ./
# Install Python dependencies (if needed)
RUN pip install --no-cache-dir --upgrade -r requirements.txt
# Expose the port Flask runs on
EXPOSE 7860
# Build and publish the C# project
RUN dotnet publish -c Release -o out
# Use a runtime image for the published output
FROM mcr.microsoft.com/dotnet/aspnet:6.0
WORKDIR /app
# Copy the published output from the build stage
COPY --from=build-env /app/out .
# Command to run the Flask app (Python and .NET can run simultaneously)
CMD ["python", "main.py"]