-
Notifications
You must be signed in to change notification settings - Fork 111
/
Copy pathDockerfile
113 lines (93 loc) · 3.21 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# requires authentication to Dockerhub
FROM audius/contracts:1.0.0 as contracts
FROM alpine:3.15
LABEL maintainer="Hareesh Nagaraj <hareesh@audius.co>"
ENV INSTALL_PATH /audius-discovery-provider
RUN mkdir -p $INSTALL_PATH
WORKDIR $INSTALL_PATH
RUN echo 'http://dl-cdn.alpinelinux.org/alpine/v3.10/main' >> /etc/apk/repositories && \
apk update && \
apk add alpine-sdk && \
apk add linux-headers && \
apk add bash && \
apk add libffi-dev && \
apk add redis && \
apk add sudo && \
apk add go-ipfs && \
apk add libpq=11.12-r0 && \
apk add postgresql=11.12-r0 && \
apk add postgresql-client=11.12-r0 && \
apk add postgresql-contrib=11.12-r0 && \
apk add postgresql-libs=11.12-r0 && \
apk add python3 && \
apk add python3-dev && \
apk add py3-pip && \
apk add py3-wheel && \
apk add rsyslog && \
apk add docker && \
apk add nodejs && \
apk add npm && \
apk add curl && \
apk add --virtual .build-deps gcc musl-dev postgresql-dev=11.12-r0
COPY requirements.txt requirements.txt
RUN apk add libseccomp-dev && \
# Upgrade pip to accomodate anchor.py installation
python3 -m pip install --upgrade pip && \
python3 -m pip install -r requirements.txt --no-cache-dir && \
apk --purge del .build-deps
RUN echo 'http://mirror.leaseweb.com/alpine/v3.13/community' >> /etc/apk/repositories && \
apk add wget && \
wget 'http://openresty.org/package/admin@openresty.com-5ea678a6.rsa.pub' && \
mv 'admin@openresty.com-5ea678a6.rsa.pub' /etc/apk/keys/ && \
source /etc/os-release && \
MAJOR_VER=`echo $VERSION_ID | sed 's/\.[0-9]\+$//'` && \
echo "http://openresty.org/package/alpine/v$MAJOR_VER/main" | tee -a /etc/apk/repositories && \
apk update && \
apk add openresty && \
apk add openresty-opm && \
opm get spacewander/lua-resty-rsa && \
opm get ledgetech/lua-resty-http && \
mkdir /usr/local/openresty/conf && \
mkdir /usr/local/openresty/logs
# versions
# alpine-sdk 1.0-r1
# linux-headers 5.10.41-r0
# bash 5.1.16-r0
# libffi-dev 3.4.2-r1
# redis 6.2.7-r0
# sudo 1.9.8_p2-r1
# go-ipfs 0.10.0-r2
# python3 3.9.7-r4
# python3-dev 3.9.7-r4
# py3-pip 20.3.4-r1
# py3-wheel 0.36.2-r2
# libpq 14.2-r0
# postgresql 11.12-r0
# postgresql-client 11.12-r0
# postgresql-contrib 11.12-r0
# postgresql-libs 11.12-r0
# openresty 1.19.9.1-r0
COPY . .
RUN cp ./nginx_conf/* /usr/local/openresty/conf/
# Add the wait script to the image
# Script originally from https://github.com/ufoscout/docker-compose-wait/releases/download/2.4.0/wait
COPY scripts/wait /wait
RUN chmod +x /wait
# Permission scripts directory
RUN chmod +x scripts/*
RUN mkdir -p ./build/contracts
COPY --from=contracts /usr/src/app/build/contracts/ ./build/contracts/
RUN bash scripts/init-db.sh
ARG git_sha
ARG audius_loggly_disable
ARG audius_loggly_token
ARG audius_loggly_tags
ENV GIT_SHA=$git_sha
ENV audius_loggly_disable=$audius_loggly_disable
ENV audius_loggly_token=$audius_loggly_token
ENV audius_loggly_tags=$audius_loggly_tags
ENV PROMETHEUS_MULTIPROC_DIR /prometheus_data
RUN mkdir -p ${PROMETHEUS_MULTIPROC_DIR}
HEALTHCHECK --interval=5s --timeout=5s \
CMD curl -f http://localhost:5000/health_check || exit 1
CMD ["bash", "scripts/start.sh"]