-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Dockerfile (includes OTP update) (#41)
- Loading branch information
Showing
1 changed file
with
22 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,29 @@ | ||
FROM erlang:21-alpine AS build | ||
FROM hexpm/erlang:25.3.2.3-alpine-3.18.2 AS erlang | ||
|
||
WORKDIR /root | ||
WORKDIR /app | ||
ENV REBAR_VERSION=3.22.0 | ||
|
||
ADD . /root | ||
FROM erlang AS downloader | ||
|
||
RUN rebar3 escriptize | ||
RUN apk --no-cache add curl; \ | ||
mkdir -p /tmp/tools; \ | ||
curl -L https://github.com/erlang/rebar3/releases/download/${REBAR_VERSION}/rebar3 > /tmp/tools/rebar3; \ | ||
chmod +x /tmp/tools/* | ||
|
||
FROM erlang:21-alpine | ||
FROM erlang AS build | ||
|
||
COPY --from=build /root/_build/default/bin/erlang_analyzer /opt/analyzer/bin/erlang_analyzer | ||
COPY _docker/analyze.sh /opt/analyzer/bin/analyze.sh | ||
COPY --from=downloader /tmp/tools/rebar3 rebar3 | ||
COPY rebar.config rebar.lock ./ | ||
|
||
RUN ./rebar3 get-deps | ||
|
||
COPY src/ src/ | ||
|
||
RUN ./rebar3 escriptize | ||
|
||
FROM erlang | ||
|
||
COPY --from=build /app/_build/default/bin/erlang_analyzer /opt/analyzer/bin/erlang_analyzer | ||
COPY _docker/analyze.sh /opt/analyzer/bin/analyze.sh | ||
|
||
ENTRYPOINT ["/opt/analyzer/bin/analyze.sh"] |