This repository was archived by the owner on Nov 25, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
51 lines (39 loc) · 1.31 KB
/
Dockerfile
File metadata and controls
51 lines (39 loc) · 1.31 KB
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
FROM alpine:3.3
MAINTAINER Alexey Kutepov <reximkut@gmail.com>
ENV OTP_VERSION 19.0
# Download the Erlang/OTP source
RUN mkdir /buildroot
WORKDIR /buildroot
ADD https://github.com/erlang/otp/archive/OTP-${OTP_VERSION}.tar.gz .
RUN tar zxf OTP-${OTP_VERSION}.tar.gz
# Install additional packages
RUN apk add --no-cache autoconf && \
apk add --no-cache alpine-sdk && \
apk add --no-cache openssl-dev
# Build Erlang/OTP
WORKDIR otp-OTP-${OTP_VERSION}
RUN ./otp_build autoconf && \
CFLAGS="-Os" ./configure --prefix=/buildroot/erlang/${OTP_VERSION} --without-termcap --disable-hipe && \
make -j10
# Install Erlang/OTP
RUN mkdir -p /buildroot/erlang/${OTP_VERSION} && \
make install
# Install Rebar3
RUN mkdir -p /buildroot/rebar3/bin
ADD https://s3.amazonaws.com/rebar3/rebar3 /buildroot/rebar3/bin/rebar3
RUN chmod a+x /buildroot/rebar3/bin/rebar3
# Setup Environment
ENV PATH=/buildroot/erlang/${OTP_VERSION}/bin:/buildroot/rebar3/bin:$PATH
# Reset working directory
WORKDIR /buildroot
# Add Tsoder application
RUN mkdir tsoder/
COPY . tsoder/
WORKDIR tsoder/
RUN ./scripts/create_db.erl "/tmp/tsoder.mnesia/"
RUN rebar3 release -o /artifacts
# TODO(#105): Extract log/ folder to volume
# Create a volume
VOLUME ["/tmp/tsoder.mnesia/"]
# Run the tsoder application
CMD ["/artifacts/tsoder/bin/tsoder", "foreground"]