These are chat archives for azukiapp/azk

8th
Mar 2016
Julio Makdisse Saito
@saitodisse
Mar 08 2016 02:17
@slobo: :clap: :clap: :clap:
Julio Makdisse Saito
@saitodisse
Mar 08 2016 04:25
A simple way to deploy static websites into small servers (512MB): https://github.com/azukiapp/static-nginx-boilerplate
Andreas Schmelas
@m9dfukc
Mar 08 2016 07:47
@saitodisse @fearenales ... sure, here is my Azkfile:
systems({
  'craftcms': {
    depends: [ 'mariadb' ],
    image: { 'docker': 'azukiapp/php-apache' },
    provision: [
      'composer self-update',
      'composer install',
      'npm install'
    ],
    workdir: '/azk/#{manifest.dir}',
    shell: '/bin/bash',
    wait: { 'retry': 25, 'timeout': 1000},
    mounts: {
      '/azk/#{manifest.dir}/node_modules': persistent('node_modules'),
      '/azk/#{manifest.dir}/vendor': persistent('vendor'),
      '/azk/#{manifest.dir}': sync('.', {'shell': true})
    },
    scalable: { 'default': 1 },
    http: {
      domains: [ '#{system.name}.#{azk.default_domain}' ]
    },
    ports: {
      http: '8080:80/tcp'
    },
    envs: {
      APP_DIR: '/azk/#{manifest.dir}'
    }
  },
  'mariadb': {
    image: { 'docker': 'mariadb:10.1.10' },
    shell: '/bin/bash',
    wait: 25,
    mounts: {
      '/var/lib/mysql': persistent('mariadb_data'),
    },
    ports: {
      data: '3306:3306/tcp',
    },
    envs: {
      MYSQL_USER         : 'azk',
      MYSQL_PASSWORD     : 'azk',
      MYSQL_ROOT_PASSWORD: 'azk',
      MYSQL_DATABASE     : 'dev'
    },
    export_envs: {
      DATABASE_URL: 'mysql2://#{envs.MYSQL_USER}:#{envs.MYSQL_PASSWORD}@#{net.host}:#{net.port.data}/#{envs.MYSQL_DATABASE}',
      DB_HOST: '#{net.host}',
      DB_PORT: '#{net.port.data}',
      DB_NAME: '#{envs.MYSQL_DATABASE}',
      DB_USER: '#{envs.MYSQL_USER}',
      DB_PASS: '#{envs.MYSQL_PASSWORD}'
    }
  }
});
Bartek Kus
@Bartekus
Mar 08 2016 08:48
1457426712164 - Origin: Worker (PID 207)
   [Error] Error: Could not locate the bindings file. Tried:
 → /azk/8c45e57/node_modules/bcrypt/build/bcrypt_lib.node
 → /azk/8c45e57/node_modules/bcrypt/build/Debug/bcrypt_lib.node
 → /azk/8c45e57/node_modules/bcrypt/build/Release/bcrypt_lib.node
 → /azk/8c45e57/node_modules/bcrypt/out/Debug/bcrypt_lib.node
 → /azk/8c45e57/node_modules/bcrypt/Debug/bcrypt_lib.node
 → /azk/8c45e57/node_modules/bcrypt/out/Release/bcrypt_lib.node
 → /azk/8c45e57/node_modules/bcrypt/Release/bcrypt_lib.node
 → /azk/8c45e57/node_modules/bcrypt/build/default/bcrypt_lib.node
 → /azk/8c45e57/node_modules/bcrypt/compiled/5.2.0/linux/x64/bcrypt_lib.node
    at bindings (/azk/8c45e57/node_modules/bindings/bindings.js:88:9)
    at Object.<anonymous> (/azk/8c45e57/node_modules/bcrypt/bcrypt.js:3:35)
    at Module._compile (module.js:399:26)
    at Module._extensions..js (module.js:406:10)
    at Object.require.extensions.(anonymous function) [as .js] (/azk/8c45e57/node_modules/babel-register/lib/node.js:134:7)
    at Module.load (module.js:345:32)
    at Function.Module._load (module.js:302:12)
    at Module.require (module.js:355:17)
    at require (internal/module.js:13:17)
    at Object.<anonymous> (/azk/8c45e57/src/server/graphql/models/User/userQuery.js:27:15)
    at Module._compile (module.js:399:26)
    at loader (/azk/8c45e57/node_modules/babel-register/lib/node.js:126:5)
    at Object.require.extensions.(anonymous function) [as .js] (/azk/8c45e57/node_modules/babel-register/lib/node.js:136:7)
    at Module.load (module.js:345:32)
    at Function.Module._load (module.js:302:12)
    at Module.require (module.js:355:17)
    at require (internal/module.js:13:17)
1457426712200 - Worker 0 exited - Exit code: 1
No matter what I do, I just can’t deploy it… it works localy just fine but when deployed I get this each and every time… any ideas what’s that all about? I even tried to install this https://www.npmjs.com/package/bindings
… I just dunno :/
Bartek Kus
@Bartekus
Mar 08 2016 08:54
also cant execute node-gyp rebuild which seems to be needed to fix this :(
Vytenis
@FDiskas
Mar 08 2016 09:12
how should I run bower in azk container?
bower ESUDO         Cannot be run with sudo
Vytenis
@FDiskas
Mar 08 2016 09:34
I will wait for permissions fix. Skipping azk again.
Julio Makdisse Saito
@saitodisse
Mar 08 2016 11:41
@FDiskas just use --allow-root option: just like that: https://github.com/azukiapp/static-nginx-boilerplate/blob/master/Azkfile.js#L119
@Bartekus If locally work, must work on deploy too. See if the deploy machine has enough memory. Maybe you should use just a static server.
Julio Makdisse Saito
@saitodisse
Mar 08 2016 11:52
@m9dfukc Maybe you should go back with path and check for your composer install files. Like node_modules in node, php generates a lot of files. Try to put these files inside a persistent folder too.
I'm not a PHP expert. Maybe this works:
'/azk/#{manifest.dir}/composer.phar': persistent('./composer.phar'),
'/azk/#{manifest.dir}/composer.lock': path('./composer.lock'),
Marcus Gadbem
@marcusgadbem
Mar 08 2016 15:23
@FDiskas as @saitodisse mentioned you can do that with --allow-root but one thing to observe is that this is not azk related, but Docker. Docker runs everything as root by default.
You can either create another user on your Dockerfile or with --user flag to run these tools (Apache is also not recommended to run as root) or stick with --allow-root
Marcus Gadbem
@marcusgadbem
Mar 08 2016 15:35
Ops, one mistake: you can only use the --user flag once you have it created by your Dockerfile
Andreas Schmelas
@m9dfukc
Mar 08 2016 17:23
@saitodisse - what bothers me is that there are no files synced at all ... if I use the "sync" option and ssh into the VM the folder is empty (I'm using the {'shell': true} option).
Felipe Arenales Santos
@fearenales
Mar 08 2016 18:07
@m9dfukc all files and dirs in the specified path (. in your case) are synced unless they're:
1) mounted using path();
2) mounted using persistent();
3) declared in .gitignore.
can you run ps -ef | grep sync in your machine, please?
plus, may you run rsync --version?
Bartek Kus
@Bartekus
Mar 08 2016 19:37
@saitodisse You are right, I’m very certain that it is memory related… I’ll try to tighten the build, since otherwise it’s everything ok
Julio Makdisse Saito
@saitodisse
Mar 08 2016 20:20
@Bartekus strange erros happens. I can help you to do something like this: https://github.com/azukiapp/static-nginx-boilerplate