forked from 0zzyx/bcnode-patched
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
77 lines (54 loc) · 1.49 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
FROM node:9.4
MAINTAINER Tomas Korcak <[email protected]>
RUN apt-get update && apt-get install -y \
libboost-dev \
unzip
# Install yarn
RUN curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.9.1 \
&& export PATH=$HOME/.yarn/bin:$PATH
ENV PATH "/root/.yarn/bin:$PATH"
# Install protobuf
RUN curl -OL https://github.com/google/protobuf/releases/download/v3.5.1/protoc-3.5.1-linux-x86_64.zip \
&& unzip protoc-3.5.1-linux-x86_64.zip -d /root/protoc3 \
&& export PATH=$HOME/protoc3/bin:$PATH
ENV PATH "/root/protoc3/bin:$PATH"
# Install nightly rust
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly \
&& export PATH=$HOME/.cargo/bin:$PATH \
&& rustup update \
&& rustc -Vv \
&& cargo -V \
&& rustup component add rust-src
ENV PATH "/root/.cargo/bin:$PATH"
# Install neon-bindings
RUN npm install -g neon-cli forever
# Create /src folder and switch to it
RUN mkdir /src
WORKDIR /src
# Support for mounted volumes
VOLUME /src/_data
VOLUME /src/_debug
VOLUME /src/_logs
VOLUME /src/config
# Get JS deps
COPY ["package.json", "yarn.lock", "./"]
RUN yarn
# Add and build native (rust) stuff
ADD native native
ADD rust rust
ADD protos protos
ADD src/protos src/protos
RUN neon build
# Git -> .version.json
COPY . .
# Install packages
RUN yarn
# Initial transpile
RUN yarn transpile
# Build all
RUN yarn run dist
RUN rm -rf native/target/
RUN rm -rf target/
RUN mkdir -p /src/logs
EXPOSE 3000 9090
ENTRYPOINT [ "./bin/cli" ]