ihp.dockerfile 535 B

12345678910111213141516171819
  1. FROM nixos/nix
  2. # Add build dependencies
  3. RUN nix-env -f https://github.com/NixOS/nixpkgs/archive/54b4bb956f9891b872904abdb632cea85a033ff2.tar.gz -iA cachix
  4. RUN cachix use digitallyinduced
  5. COPY ./src /ihp
  6. WORKDIR /ihp
  7. # Build
  8. RUN nix --extra-experimental-features "nix-command flakes" build -j auto --cores 0 .#optimized-prod-server
  9. # Setup
  10. ENV DATABASE_URL=postgres://benchmarkdbuser:benchmarkdbpass@tfb-database:5432/hello_world
  11. ENV PORT=8080
  12. EXPOSE 8080
  13. # Run
  14. CMD ./result/bin/RunProdServer +RTS -A32m -N$(nproc) -qn2 -M2G -RTS