Skip to content
Snippets Groups Projects
Select Git revision
  • main default protected
1 result

README.md

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    Dockerfile 913 B
    FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
    WORKDIR /App
    
    # Copy everything
    COPY . ./
    
    # Restore as distinct layers
    RUN dotnet restore
    
    # Build and publish a release
    RUN dotnet publish -c Release -o out
    
    # Build runtime image
    FROM mcr.microsoft.com/dotnet/aspnet:8.0
    
    # Install cron and other necessary packages
    RUN apt-get update && \
        apt-get install -y cron && \
        apt-get clean
    
    WORKDIR /App
    COPY --from=build-env /App/out .
    
    # Copy the cron job file to /etc/cron.d/
    COPY graph-deployer-cron /etc/cron.d/
    
    # Give execution rights on the cron job file
    RUN chmod 0644 /etc/cron.d/graph-deployer-cron
    
    # Apply the cron job
    RUN crontab /etc/cron.d/graph-deployer-cron
    
    # Set the build-time argument and default environment variable
    ENV DOTNET_ENVIRONMENT=Development
    
    # Create the log file
    RUN touch /var/log/cron.log
    
    ENTRYPOINT /bin/sh -c "cron;/App/Coscine.GraphDeployer;tail -f /var/log/cron.log"