https://github.com/bitwalker/alpine-elixir
A Dockerfile based on my alpine-erlang image for Elixir applications
https://github.com/bitwalker/alpine-elixir
Last synced: 7 months ago
JSON representation
A Dockerfile based on my alpine-erlang image for Elixir applications
- Host: GitHub
- URL: https://github.com/bitwalker/alpine-elixir
- Owner: bitwalker
- License: mit
- Created: 2016-11-01T20:25:54.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-08-29T14:40:04.000Z (over 1 year ago)
- Last Synced: 2025-02-15T08:20:13.990Z (about 1 year ago)
- Language: Makefile
- Size: 71.3 KB
- Stars: 209
- Watchers: 9
- Forks: 83
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Elixir on Alpine Linux
This Dockerfile provides a full installation of Erlang and Elixir on Alpine, intended for running releases,
so it has no build tools installed. The Erlang installation is provided so one can avoid cross-compiling
releases. The caveat of course is if one has NIFs which require a native compilation toolchain, but that is
left as an exercise for the reader.
## Usage
NOTE: This image sets up a `default` user, with home set to `/opt/app` and owned by that user. The working directory
is also set to `$HOME`. It is highly recommended that you add a `USER default` instruction to the end of your
Dockerfile so that your app runs in a non-elevated context.
To boot straight to a prompt in the image:
```
$ docker run --rm -it --user=root bitwalker/alpine-elixir iex
Erlang/OTP XX [erts-X.X] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [hipe] [kernel-poll:false]
Interactive Elixir () - press Ctrl+C to exit (type h() ENTER for help)
iex(1)>
```
Extending for your own application:
```dockerfile
FROM bitwalker/alpine-elixir:latest
# Set exposed ports
EXPOSE 5000
ENV PORT=5000
ENV MIX_ENV=prod
COPY yourapp.tar.gz ./
RUN tar -xzvf yourapp.tar.gz
USER default
CMD ./bin/yourapp foreground
```
## License
MIT