nicbet / docker-phoenix

A dockerized Phoenix development and runtime environment.
GNU General Public License v3.0
282 stars 58 forks source link

bcrypt not working #37

Closed TheBlckbird closed 1 year ago

TheBlckbird commented 1 year ago

I tried to scaffold the auth system, but bcrypt doesn’t work:

I am on macOS 14.0 and am using the latest version of Phoenix Framework.

TheBlckbird commented 1 year ago

The same happens with argon2

TheBlckbird commented 1 year ago

You have to run this command before executing mix ecto.migrate: apk add build-base

TheBlckbird commented 1 year ago

But Bcrypt is still unavailable

TheBlckbird commented 1 year ago

I get the error Module Bcrypt not found

nicbet commented 1 year ago

@TheBlckbird sorry for the long wait. Work and family took a precedence over open-source the past weeks.

The Docker image does not include the build-base package that provides the make and cc commands to compile the bcrypt_elixir module.

You can run apk add build-base and then retry mix deps.compile to resolve the issue (just tested working in a brand new container / app).

I'll think for bit on whether we should include build-base in the image by default or not.

TheBlckbird commented 1 year ago

Thanks, I’ll try that out. I think we should include build-base by default, because a lot of applications have some kind of encryption and authentication.

nicbet commented 1 year ago

Agreed, since the primary concern of the repo is to provide an easy out of the box dev experience, not a production runtime container, and many dependencies need to be compiled, we should have build-base baked in.

I’ll add it to the next release.

nicbet commented 1 year ago

build-base package is now included by default starting from 1.7.5 release.

TheBlckbird commented 1 year ago

Thank you!