<commit_before># Docker stuff
fs = require 'fs'
mkdirp = require 'mkdirp'
YAML = require 'yamljs'

# Gen docker file
createDockerFile = (dir) ->
  # body...
  if fs.existsSync(dir) != true
    mkdirp(dir)
  # Create file
  fs.open("#{dir}/Dockerfile", 'w', (err) ->
    # body...
    if err
      # body...
      throw new Error(err)
  )



# Docker class
class DockerFileDefault
  constructor: (tub, appdir) ->
    # body...
    @dir = appdir
    @tub = tub
    @file = "#{@dir}/.jakhu/#{@tub}/Dockerfile"
    @compose = {}
    createDockerFile("#{appdir}/.jakhu/#{tub}")
  image: (lang) ->
    fs.appendFileSync @file, "FROM jakhu/#{lang}:latest\nRUN sudo chown -R jakhu /runner\n"
  cwd: () ->
    fs.appendFileSync @file, 'CMD bash -c "sudo chmod 777 /runner/bin/jakhurun && source /home/jakhu/.rvm/scripts/rvm && rvm use ruby-head && ~/.jakhu/bin/jakhurun --version"'



genDockerFile = (tub, appdir, yml) ->
  # body...
  docker = new DockerFileDefault(tub, appdir)
  @compose = {}
  docker.image(yml.language)
  docker.cwd()
  # Create Compose YAML file
  f = 0<commit_msg>Update docker.coffee<commit_after># Docker stuff
fs = require 'fs'
mkdirp = require 'mkdirp'
YAML = require 'yamljs'

# Gen docker file
createDockerFile = (dir) ->
  # body...
  if fs.existsSync(dir) != true
    mkdirp(dir)
  # Create file
  fs.open("#{dir}/Dockerfile", 'w', (err) ->
    # body...
    if err
      # body...
      throw new Error(err)
  )



# Docker class
class DockerFileDefault
  constructor: (tub, appdir) ->
    # body...
    @dir = appdir
    @tub = tub
    @file = "#{@dir}/.jakhu/#{@tub}/Dockerfile"
    @compose = {}
    createDockerFile("#{appdir}/.jakhu/#{tub}")
  image: (lang) ->
    fs.appendFileSync @file, "FROM jakhu/#{lang}:latest\nRUN sudo chown -R jakhu /runner\n"
  cwd: () ->
    fs.appendFileSync @file, 'CMD bash -c "sudo chmod 777 /runner/bin/jakhurun && source /home/jakhu/.rvm/scripts/rvm && rvm use ruby-head && /runner/bin/jakhurun start"'



genDockerFile = (tub, appdir, yml) ->
  # body...
  docker = new DockerFileDefault(tub, appdir)
  @compose = {}
  docker.image(yml.language)
  docker.cwd()
  # Create Compose YAML file
  f = 0
{'fraction_non_alphanumeric': 0.17345050878815912, 'fraction_numerical': 0.0037002775208140612, 'mean_word_length': 2.8487544483985765, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6465599', 'n_tokens_mistral': 879, 'n_tokens_neox': 812, 'n_words': 192}