forked from AeonLucid/POGOProtos
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
100 lines (81 loc) · 2.64 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
# To build a docker container for the "master" branch (this is the default) execute:
#
# docker build --build-arg BUILD_BRANCH=master .
# (or)
# docker build .
#
# To build a docker container for the "dev" branch execute:
#
# docker build --build-arg BUILD_BRANCH=dev .
#
# You can also build from different fork and specify a particular commit as the branch
#
# docker build --build-arg BUILD_REPO=YourFork/PokemonGo-Bot --build-arg BUILD_BRANCH=6a4580f .
FROM alpine
ARG BUILD_REPO=goedzo/POGOProtos
ARG BUILD_BRANCH=master
ARG BUILD_REPO2=goedzo/pgoapi
LABEL build_repo=$BUILD_REPO build_branch=$BUILD_BRANCH
WORKDIR /usr/src/app
VOLUME ["/usr/src/app/configs", "/usr/src/app/web"]
RUN apk -U --no-cache add python py-pip tzdata \
&& rm -rf /var/cache/apk/* \
&& find / -name '*.pyc' -o -name '*.pyo' | xargs -rn1 rm -f
ADD https://raw.githubusercontent.com/$BUILD_REPO/$BUILD_BRANCH/requirements.txt .
#Need to load cert for WGET
RUN apk update
RUN apk add ca-certificates wget
RUN update-ca-certificates
RUN wget -P /tmp/ http://pgoapi.com/pgoencrypt.tar.gz
RUN apk -U --no-cache add --virtual .build-dependencies python-dev gcc make musl-dev git
RUN tar xvzf /tmp/pgoencrypt.tar.gz -C /tmp
RUN make -C /tmp/pgoencrypt/src
RUN cp /tmp/pgoencrypt/src/libencrypt.so /usr/src/app/encrypt.so
RUN ln -s locale.h /usr/include/xlocale.h
RUN pip install --no-cache-dir -r requirements.txt
RUN apk del .build-dependencies
RUN rm -rf /var/cache/apk/* /tmp/pgoencrypt* /usr/include/xlocale.h
RUN find / -name '*.pyc' -o -name '*.pyo' | xargs -rn1 rm -f
RUN apk update
RUN apk add bash
RUN apk update
RUN apk add mc
RUN apk update
RUN apk add git
# Install Protoc
################
RUN set -ex \
&& apk --no-cache add --virtual .pb-build \
make \
cmake \
autoconf \
automake \
curl \
tar \
libtool \
g++ \
\
&& mkdir -p /tmp/protobufs \
&& cd /tmp/protobufs \
&& curl -o protobufs.tar.gz -L https://github.com/google/protobuf/releases/download/v3.3.0/protobuf-cpp-3.3.0.tar.gz \
&& mkdir -p protobuf \
&& tar -zxvf protobufs.tar.gz -C /tmp/protobufs/protobuf --strip-components=1 \
&& cd protobuf \
&& ./autogen.sh \
&& ./configure --prefix=/usr \
&& make \
&& make install \
&& cd \
&& rm -rf /tmp/protobufs/ \
&& rm -rf /tmp/protobufs.tar.gz \
&& apk --no-cache add libstdc++ \
&& apk del .pb-build \
&& rm -rf /var/cache/apk/* \
&& mkdir /defs
# Setup directories for the volumes that should be used
WORKDIR /defs
RUN git clone -b $BUILD_BRANCH https://github.com/goedzo/POGOProtos /src/pogoprotos/
RUN git clone https://github.com/goedzo/pgoapi /src/pgoapi/
RUN cp /src/pogoprotos/run.sh /src/run.sh
RUN chmod +x /src/run.sh
CMD ["/bin/bash"]