forked from Glimesh/glimesh.tv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
58 lines (40 loc) · 1.24 KB
/
Dockerfile
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Doesn't use alpine because we need dart-sass to work and it needs glibc
FROM elixir:1.13.1 AS build
RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash -
RUN apt-get install -y nodejs
# prepare build dir
WORKDIR /app
# install hex + rebar
RUN mix local.hex --force && \
mix local.rebar --force
# set build ENV
ENV MIX_ENV=prod
# install mix dependencies
COPY mix.exs mix.lock ./
COPY config config
RUN mix do deps.get, deps.compile
# workaround for janus npm install
RUN git config --global url."https://github.com".insteadOf ssh://[email protected]
# build assets
COPY assets/package.json assets/package-lock.json ./assets/
RUN npm --prefix ./assets ci --progress=false --no-audit --loglevel=error
COPY priv priv
COPY assets assets
RUN mix assets.deploy
# compile and build release
COPY lib lib
# uncomment COPY if rel/ exists
# COPY rel rel
RUN mix do compile, release
# prepare release image
FROM alpine:3.15 AS app
RUN apk add --no-cache openssl gcc libc-dev ncurses-libs imagemagick librsvg npm
RUN npm install -g svgo
WORKDIR /app
RUN chown nobody:nobody /app
USER nobody:nobody
COPY --from=build --chown=nobody:nobody /app/_build/prod/rel/glimesh ./
ENV HOME=/app
RUN ls /app
RUN ls /app/erts-12.2/bin/
CMD ["bin/glimesh", "start"]