Dockerfile (1536B)
1 # Zenflows is designed to implement the Valueflows vocabulary, 2 # written and maintained by srfsh <info@dyne.org>. 3 # Copyright (C) 2021-2023 Dyne.org foundation <foundation@dyne.org>. 4 # 5 # This program is free software: you can redistribute it and/or modify 6 # it under the terms of the GNU Affero General Public License as published by 7 # the Free Software Foundation, either version 3 of the License, or 8 # (at your option) any later version. 9 # 10 # This program is distributed in the hope that it will be useful, 11 # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 # GNU Affero General Public License for more details. 14 # 15 # You should have received a copy of the GNU Affero General Public License 16 # along with this program. If not, see <https://www.gnu.org/licenses/>. 17 18 ARG MIX_ENV=prod 19 20 21 FROM elixir:1.14-alpine AS build 22 ARG MIX_ENV 23 ENV MIX_ENV=$MIX_ENV 24 25 WORKDIR /app 26 27 RUN mix do local.hex --force, local.rebar --force 28 29 COPY mix.exs mix.lock ./ 30 COPY conf/buildtime.exs conf/ 31 COPY .deps deps 32 RUN mix deps.compile --only "$MIX_ENV" 33 34 COPY conf conf 35 COPY priv priv 36 COPY src src 37 RUN mix do compile, release 38 39 40 FROM alpine:3.16 AS app 41 ARG MIX_ENV 42 ENV MIX_ENV=$MIX_ENV 43 44 RUN apk add --no-cache libstdc++ ncurses-libs 45 46 ARG USER=zenflows GROUP=zenflows 47 RUN addgroup -S "$GROUP" && adduser -SG"$GROUP" "$USER" 48 USER "$USER" 49 50 WORKDIR /app 51 52 COPY --from=build --chown="$USER:$GROUP" /app/_build/"$MIX_ENV"/rel/zenflows ./ 53 54 EXPOSE 8000 55 56 ENTRYPOINT ["bin/zenflows"] 57 58 CMD ["start"]