-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
76 lines (58 loc) · 2.14 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 likesistemas/cordova:stable
RUN apt-get update && apt-get install -y \
git \
unzip \
vim \
jq \
curl
ENV TZ="America/Fortaleza"
ENV ROOT="/root/"
ENV APP_NAME="app"
ENV ROOT_APP_NAME="${ROOT}${APP_NAME}/"
ENV WEBPACK_BUILD_COMMAND="build:cordova"
ENV BUILD_FOLDER="www"
VOLUME ${ROOT}apk/
WORKDIR ${ROOT}
RUN cordova telemetry on \
&& cordova create ${APP_NAME}
WORKDIR ${ROOT_APP_NAME}
RUN apt-get update && apt-get install -y curl gnupg2 lsb-release && \
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \
apt-key fingerprint 1655A0AB68576280 && \
export VERSION=node_14.x && \
export DISTRO="$(lsb_release -s -c)" && \
echo "deb https://deb.nodesource.com/$VERSION $DISTRO main" | tee /etc/apt/sources.list.d/nodesource.list && \
echo "deb-src https://deb.nodesource.com/$VERSION $DISTRO main" | tee -a /etc/apt/sources.list.d/nodesource.list && \
apt-get update && apt-get install -y nodejs && \
node -v && npm -v && \
npm install -g yarn && \
yarn -v && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN npm install -g npm@latest
RUN npm install -g cordova@latest
RUN node -v && npm -v && cordova -v
RUN apt-get update && apt-get install build-essential -y --no-install-recommends
RUN cordova platform add android@latest \
&& cordova plugin add cordova-plugin-geolocation \
&& cordova plugin add cordova-plugin-whitelist \
&& cordova plugin add cordova-android-support-gradle-release
RUN cordova build android
RUN rm -rf www/
WORKDIR ${ROOT}
COPY sh/nodejs/package.* nodejs/
RUN cd nodejs/ && npm install && cd ..
COPY sh/ /usr/local/bin/
COPY sh/nodejs/*.js nodejs/
RUN chmod +x /usr/local/bin/prepare.sh \
&& chmod +x /usr/local/bin/build.sh \
&& chmod +x /usr/local/bin/bundle.sh \
&& chmod +x /usr/local/bin/fbuild.sh \
&& chmod +x /usr/local/bin/release.sh \
&& chmod +x /usr/local/bin/frelease.sh \
&& chmod +x /usr/local/bin/entrypoint.sh \
&& chmod +x /usr/local/bin/change-version.sh \
&& chmod +x /usr/local/bin/compile-webpack.sh
RUN rm -rf /var/lib/apt/lists/*
WORKDIR ${ROOT_APP_NAME}
ENTRYPOINT [ "entrypoint.sh" ]