forked from smartcontractkit/chainlink
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdevelop.Dockerfile
More file actions
68 lines (57 loc) · 2.33 KB
/
develop.Dockerfile
File metadata and controls
68 lines (57 loc) · 2.33 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
FROM smartcontract/builder:1.0.36
# Add the PostgreSQL PGP key & repository
RUN apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" > /etc/apt/sources.list.d/pgdg.list
# Install deps
RUN apt-get update && apt-get install -y postgresql postgresql-contrib direnv build-essential cmake libudev-dev unzip
# Install additional tooling
RUN mkdir -p ~/.local/bin/
ENV PATH="/root/.local/bin:${PATH}"
RUN go get github.com/go-delve/delve/cmd/dlv
RUN go get github.com/google/gofuzz
RUN yarn global add ganache-cli
RUN pip3 install web3 slither-analyzer crytic-compile
RUN curl -L https://github.com/crytic/echidna/releases/download/v1.5.1/echidna-test-v1.5.1-Ubuntu-18.04.tar.gz | tar -xz -C ~/.local/bin
RUN curl -L https://github.com/openethereum/openethereum/releases/download/v3.0.1/openethereum-linux-v3.0.1.zip --output openethereum.zip
RUN unzip openethereum.zip -d ~/.local/bin/ && rm openethereum.zip
RUN chmod +x ~/.local/bin/*
# Setup direnv
RUN echo 'eval "$(direnv hook bash)"' > /root/.bashrc
# Setup postgres
USER postgres
RUN echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/10/main/pg_hba.conf
RUN echo "listen_addresses='*'" >> /etc/postgresql/10/main/postgresql.conf
RUN /etc/init.d/postgresql start &&\
createdb chainlink_test &&\
createdb node_dev &&\
createdb explorer_dev &&\
createdb explorer_test &&\
createuser --superuser --no-password root &&\
psql -c "ALTER USER postgres PASSWORD 'node';"
USER root
# add init file - this file starts postgres and keeps container alive after started
RUN touch ~/init
RUN chmod +x ~/init
RUN echo "#!/usr/local/bin/dumb-init /bin/sh" >> ~/init
RUN echo "/etc/init.d/postgresql start" >> ~/init
RUN echo "while true; do sleep 1; done" >> ~/init
ARG SRCROOT=/root/chainlink
WORKDIR ${SRCROOT}
EXPOSE 5432
EXPOSE 6688
EXPOSE 6689
EXPOSE 3000
EXPOSE 3001
EXPOSE 8545
EXPOSE 8546
# Default env setup for testing
ENV CHAINLINK_DB_NAME chainlink_test
ENV CHAINLINK_PGPASSWORD=node
ENV DATABASE_URL=postgresql://postgres:$CHAINLINK_PGPASSWORD@localhost:5432/$CHAINLINK_DB_NAME?sslmode=disable
ENV TYPEORM_USERNAME=postgres
ENV TYPEORM_PASSWORD=node
ENV ETH_CHAIN_ID=1337
ENV CHAINLINK_DEV=true
ENV CHAINLINK_TLS_PORT=0
ENV SECURE_COOKIES=false
ENTRYPOINT [ "/root/init" ]