-
Notifications
You must be signed in to change notification settings - Fork 3
/
Earthfile
29 lines (26 loc) · 1.14 KB
/
Earthfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
FROM hexpm/elixir:1.12.2-erlang-23.3.1-debian-stretch-20210326
WORKDIR /src/
all:
BUILD +build
build:
ARG APP_NAME=hierbautberlin
ARG APP_VERSION=0.1.0
ARG MIX_ENV=prod
RUN apt-get update
RUN apt-get install nodejs build-essential git curl poppler-utils qpdf -y
RUN curl -fsSL https://deb.nodesource.com/setup_14.x | bash -
RUN apt-get update
RUN apt-get install nodejs -y
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
COPY --dir .git config lib priv assets ./
COPY mix.exs .
COPY mix.lock .
RUN mix local.hex --force
RUN mix local.rebar --force
RUN export PATH="$HOME/.cargo/bin:$PATH" && mix do deps.get --only prod
RUN export PATH="$HOME/.cargo/bin:$PATH" && mix deps.compile
RUN curl -o- -L https://yarnpkg.com/install.sh | bash
RUN export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH" && cd assets && yarn install && yarn run deploy
RUN RUSTLER_NIF_VERSION=2.15 mix phx.digest
RUN RUSTLER_NIF_VERSION=2.15 mix release
SAVE ARTIFACT _build/${MIX_ENV}/${APP_NAME}-1.0.0+${APP_VERSION}.tar.gz AS LOCAL build/${APP_NAME}-${APP_VERSION}.tar.gz