Skip to content
Snippets Groups Projects
Select Git revision
  • aa37e0c26b1fac84ed5d0c238f02f7a4c516c232
  • master default protected
  • dev protected
  • Issue/3130-onboardingUzK
  • Issue/3109-onboarding
  • Issue/2915-migrateSql2Linked
  • test_ci
  • Issue/xxxx-fixDevcontainer
  • Issue/xxxx-generateLatestTag
  • Issue/2980-fixContainerBuild
  • Issue/2967-fixGD
  • Issue/2944-gdShenanigans
  • Issue/2906-containerCron
  • Issue/2880-gd
  • petar.hristov-master-patch-9e49
  • Issue/2668-graphDeployer
  • gitkeep
  • Hotfix/xxxx-fastDeployment
  • Hotfix/2615-graphDeployerLag
  • Issue/2568-betterLogging
  • Issue/2518-docs
  • v2.1.11
  • v2.1.10
  • v2.1.9
  • v2.1.8
  • v2.1.7
  • v2.1.6
  • v2.1.5
  • v2.1.4
  • v2.1.3
  • v2.1.2
  • v2.1.1
  • v2.1.0
  • v2.0.1
  • v2.0.0
  • v1.2.11
  • v1.2.10
  • v1.2.9
  • v1.2.8
  • v1.2.7
  • v1.2.6
41 results

Dockerfile

Blame
  • L. Ellenbeck's avatar
    L. Ellenbeck authored and Petar Hristov committed
    76f8bcfb
    History
    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"