-
Notifications
You must be signed in to change notification settings - Fork 115
/
Dockerfile
61 lines (40 loc) · 1.18 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
59
60
61
# ===================== base =====================
FROM elixir:alpine as build
# install build dependencies
RUN apk add --update git make gcc libc-dev autoconf libtool automake
# set build dir
WORKDIR /app
# install hex + rebar
RUN mix local.hex --force && \
mix local.rebar --force
ENV MIX_ENV=standalone_crawly
# install mix dependencies
COPY mix.exs mix.lock /app/
COPY priv /app/priv/
COPY rel /app/rel
RUN mix deps.get
RUN mix local.rebar --force
RUN mix deps.compile
RUN mix deps.compile
# build project code
COPY config/config.exs config/
COPY config/crawly.config config/
COPY config/standalone_crawly.exs config/
# Create default config file
# COPY config/app.config /app/config/app.config
# COPY config/runtime.exs config/
COPY lib lib
RUN mix compile
COPY rel rel
## build release
RUN mix release
# =================== release ====================
FROM alpine:latest AS release
RUN apk add --update openssl make gcc libc-dev autoconf libtool automake
WORKDIR /app
RUN apk add --update bash
COPY --from=build /app/_build/standalone_crawly/rel/crawly ./
COPY --from=build /app/config /app/config
RUN mkdir /app/spiders
EXPOSE 4001
ENTRYPOINT [ "/app/bin/crawly", "start" ]