magnetissimo icon indicating copy to clipboard operation
magnetissimo copied to clipboard

docker deployment?

Open nexus-uw opened this issue 7 years ago • 5 comments

Is it possible to deploy this application in a docker container?

nexus-uw avatar Jan 28 '17 19:01 nexus-uw

Yes, a working one(tested myself) was posted here but it's not approved yet: https://github.com/sergiotapia/magnetissimo/pull/35

ghost avatar Jan 28 '17 20:01 ghost

Just finished a Pull Request that uses docker-compose to start magnetissimo and postgres

luciano-fiandesio avatar Jan 28 '17 22:01 luciano-fiandesio

You might want to look at setting up Dokku and deploying into that.

Rodeoclash avatar Jan 29 '17 23:01 Rodeoclash

When will this be merged?

ralyodio avatar Aug 06 '19 20:08 ralyodio

Looking forward to using this software but it's a no-go for me until there's a Docker install 🙏

Yours hopefully

ldexterldesign avatar Feb 11 '20 05:02 ldexterldesign

@ldexterldesign There's now a Dockerfile in the project, generated by mix phx.gen.release --docker.

Could you give it a try and report back? I would really appreciate your help in getting the Dockerfile in good shape!

sergiotapia avatar Apr 13 '23 04:04 sergiotapia

@sergiotapia I'm not the person who originally requested a Dockerfile/image, but I just tried running this via the Dockerfile.

I successfully built the Image using docker build . -t magnetissimo:latest but on docker run magnetissimo I get:

ERROR! Config provider Config.Reader failed with:
** (RuntimeError) environment variable DATABASE_URL is missing.
For example: ecto://USER:PASS@HOST/DATABASE

    /app/releases/2.0.0/runtime.exs:26: (file)
    (elixir 1.14.4) src/elixir.erl:309: anonymous fn/4 in :elixir.eval_external_handler/1
    (stdlib 4.1.1) erl_eval.erl:748: :erl_eval.do_apply/7
    (stdlib 4.1.1) erl_eval.erl:492: :erl_eval.expr/6
    (stdlib 4.1.1) erl_eval.erl:136: :erl_eval.exprs/6
    (elixir 1.14.4) src/elixir.erl:294: :elixir.eval_forms/4
    (elixir 1.14.4) lib/module/parallel_checker.ex:110: Module.ParallelChecker.verify/1
    (elixir 1.14.4) lib/code.ex:425: Code.validated_eval_string/3

{"init terminating in do_boot",{#{'__exception__'=>true,'__struct__'=>'Elixir.RuntimeError',message=><<101,110,118,105,114,111,110,109,101,110,116,32,118,97,114,105,97,98,108,101,32,68,65,84,65,66,65,83,69,95,85,82,76,32,105,115,32,109,105,115,115,105,110,103,46,10,70,111,114,32,101,120,97,109,112,108,101,58,32,101,99,116,111,58,47,47,85,83,69,82,58,80,65,83,83,64,72,79,83,84,47,68,65,84,65,66,65,83,69,10>>},[{elixir_eval,'__FILE__',1,[{file,"/app/releases/2.0.0/runtime.exs"},{line,26}]},{elixir,'-eval_external_handler/1-fun-2-',4,[{file,"src/elixir.erl"},{line,309},{error_info,#{module=>'Elixir.Exception'}}]},{erl_eval,do_apply,7,[{file,"erl_eval.erl"},{line,748}]},{erl_eval,expr,6,[{file,"erl_eval.erl"},{line,492}]},{erl_eval,exprs,6,[{file,"erl_eval.erl"},{line,136}]},{elixir,eval_forms,4,[{file,"src/elixir.erl"},{line,294}]},{'Elixir.Module.ParallelChecker',verify,1,[{file,"lib/module/parallel_checker.ex"},{line,110}]},{'Elixir.Code',validated_eval_string,3,[{file,"lib/code.ex"},{line,425}]}]}}
init terminating in do_boot ({,[{elixir_eval,__FILE__,1,[{_},{_}]},{elixir,-eval_external_handler/1-fun-2-,4,[{_},{_},{_}]},{erl_eval,do_apply,7,[{_},{_}]},{erl_eval,expr,6,[{_},{_}]},{erl_eval,exprs,6,[{_},{_}]},{elixir,eval_forms,4,[{_},{_}]},{Elixir.Module.ParallelChecker,verify,1,[{_},{_}]},{Elixir.Code,validated_eval_string,3,[{_},{_}]}]})

Crash dump is being written to: erl_crash.dump...done

Happy to attach the crash dump if you need it, but I feel like the root cause is just the unset DATABASE_URL environment variable.

Unfortunately I don't know enough about Elixir to work out how to fix that.

infinitejones avatar Apr 13 '23 23:04 infinitejones

@infinitejones this app requires a PostgresDB, so you need to set that ENV variable to a DB connection string like ecto://username:password@hostname:port/database. I put in an PR with an example here.

loganmarchione avatar Apr 14 '23 01:04 loganmarchione

@infinitejones If you pull latest you can see the docker-compose.yml file is there now - it should work out of the box assuming a Postgres instance with postgres:postgres username password default combo.

If your Postgres has different username/password combo, you can just change it in your docker-compose.yml file.

Please let me know if you see any other errors.

sergiotapia avatar Apr 14 '23 02:04 sergiotapia

👋 @sergiotapia,

Thanks for follow up - always better late than never 🙂

I tried the Docker compose file...

I got errors composing the current code but @loganmarchione's (👏) PR code works - unsure why the PR code isn't reflected in the repo yet 😕..?

Look forward to trying the app - keep up great work!

Hope this helps

Regards

ldexterldesign avatar Apr 15 '23 18:04 ldexterldesign