mirror of
https://gitlab.com/walljm/dynamicbible.git
synced 2025-07-24 16:00:11 -04:00
FEATURE: added docker files to build android app and/or just run the app.
This commit is contained in:
parent
e93c401ffa
commit
5f22f580bd
4
DynamicBibleIonic/.dockerignore
Normal file
4
DynamicBibleIonic/.dockerignore
Normal file
@ -0,0 +1,4 @@
|
||||
node_modules
|
||||
platforms
|
||||
.sourcemaps
|
||||
plugins
|
33
DynamicBibleIonic/Dockerfile
Normal file
33
DynamicBibleIonic/Dockerfile
Normal file
@ -0,0 +1,33 @@
|
||||
FROM ubuntu:16.04
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive \
|
||||
NODE_VERSION=10.13.0 \
|
||||
NPM_VERSION=6.5.0 \
|
||||
IONIC_VERSION=4.6.0
|
||||
|
||||
# Install basics
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y git wget curl unzip build-essential ruby ruby-dev ruby-ffi gcc make
|
||||
RUN curl --retry 3 -SLO "http://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.gz"
|
||||
RUN tar -xzf "node-v$NODE_VERSION-linux-x64.tar.gz" -C /usr/local --strip-components=1
|
||||
RUN rm "node-v$NODE_VERSION-linux-x64.tar.gz"
|
||||
RUN npm install -g npm@"$NPM_VERSION"
|
||||
RUN npm install -g cordova@"$CORDOVA_VERSION" ionic@"$IONIC_VERSION"
|
||||
RUN npm cache clear --force
|
||||
RUN gem install sass
|
||||
|
||||
RUN apt-get install software-properties-common -y
|
||||
RUN add-apt-repository ppa:mercurial-ppa/releases
|
||||
RUN apt-get update
|
||||
RUN apt-get install mercurial -y
|
||||
|
||||
# Test First Build so that it will be faster later
|
||||
WORKDIR /db
|
||||
RUN hg clone https://walljm@bitbucket.org/walljm/dynamicbible
|
||||
WORKDIR /db/dynamicbible/DynamicBibleIonic
|
||||
RUN hg update main
|
||||
RUN ls -laF
|
||||
RUN npm install
|
||||
|
||||
EXPOSE 8100 35729
|
||||
CMD ["build.sh"]
|
82
DynamicBibleIonic/android.Dockerfile
Normal file
82
DynamicBibleIonic/android.Dockerfile
Normal file
@ -0,0 +1,82 @@
|
||||
FROM ubuntu:16.04
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive \
|
||||
ANDROID_HOME=/opt/android-sdk-linux \
|
||||
NODE_VERSION=10.13.0 \
|
||||
NPM_VERSION=6.5.0 \
|
||||
IONIC_VERSION=4.6.0 \
|
||||
CORDOVA_VERSION=8.0.0 \
|
||||
GRADLE_VERSION=4.10.2 \
|
||||
SCMNAME="Jason Wall" \
|
||||
SCMEMAIL="jason@walljm.com"
|
||||
|
||||
# Install basics
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y git wget curl unzip build-essential ruby ruby-dev ruby-ffi gcc make
|
||||
RUN curl --retry 3 -SLO "http://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.gz"
|
||||
RUN tar -xzf "node-v$NODE_VERSION-linux-x64.tar.gz" -C /usr/local --strip-components=1
|
||||
RUN rm "node-v$NODE_VERSION-linux-x64.tar.gz"
|
||||
RUN npm install -g npm@"$NPM_VERSION"
|
||||
RUN npm install -g cordova@"$CORDOVA_VERSION" ionic@"$IONIC_VERSION"
|
||||
RUN npm cache clear --force
|
||||
RUN gem install sass
|
||||
|
||||
RUN git config --global user.email "${SCMEMAIL}" && \
|
||||
git config --global user.name "${SCMNAME}"
|
||||
|
||||
RUN apt-get install software-properties-common -y
|
||||
|
||||
RUN add-apt-repository ppa:mercurial-ppa/releases
|
||||
RUN apt-get update
|
||||
RUN apt-get install mercurial -y
|
||||
|
||||
# install python-software-properties (so you can do add-apt-repository)
|
||||
RUN apt-get update && apt-get install -y -q python-software-properties software-properties-common && \
|
||||
add-apt-repository ppa:webupd8team/java -y && \
|
||||
echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections && \
|
||||
apt-get update && apt-get -y install oracle-java8-installer
|
||||
|
||||
#ANDROID STUFF
|
||||
RUN echo ANDROID_HOME="${ANDROID_HOME}" >> /etc/environment && \
|
||||
dpkg --add-architecture i386 && \
|
||||
apt-get update && \
|
||||
apt-get install -y --force-yes expect ant wget zipalign libc6-i386 lib32stdc++6 lib32gcc1 lib32ncurses5 lib32z1 qemu-kvm kmod && \
|
||||
apt-get clean && \
|
||||
apt-get autoclean && \
|
||||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
# Install Android SDK
|
||||
RUN cd /opt && \
|
||||
wget --output-document=android-sdk.tgz --quiet http://dl.google.com/android/android-sdk_r24.4.1-linux.tgz && \
|
||||
tar xzf android-sdk.tgz && \
|
||||
rm -f android-sdk.tgz && \
|
||||
chown -R root. /opt
|
||||
|
||||
# Install Gradle
|
||||
RUN wget https://services.gradle.org/distributions/gradle-"$GRADLE_VERSION"-bin.zip && \
|
||||
mkdir /opt/gradle && \
|
||||
unzip -d /opt/gradle gradle-"$GRADLE_VERSION"-bin.zip && \
|
||||
rm -rf gradle-"$GRADLE_VERSION"-bin.zip
|
||||
|
||||
# Setup environment
|
||||
|
||||
ENV PATH ${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:/opt/tools:/opt/gradle/gradle-"$GRADLE_VERSION"/bin
|
||||
|
||||
# Install sdk elements
|
||||
COPY docker /opt/tools
|
||||
|
||||
RUN ["/opt/tools/android-accept-licenses.sh", "android update sdk --all --no-ui --filter platform-tools,tools,build-tools-26.0.2,android-27,android-26,build-tools-25.0.0,android-25,extra-android-support,extra-android-m2repository,extra-google-m2repository"]
|
||||
RUN unzip ${ANDROID_HOME}/temp/*.zip -d ${ANDROID_HOME}
|
||||
|
||||
# Test First Build so that it will be faster later
|
||||
WORKDIR /db
|
||||
RUN hg clone https://walljm@bitbucket.org/walljm/dynamicbible
|
||||
WORKDIR /db/dynamicbible/DynamicBibleIonic
|
||||
RUN hg update main
|
||||
RUN ls -laF
|
||||
RUN npm install
|
||||
RUN ionic cordova platform add android
|
||||
COPY docker/build.sh /build.sh
|
||||
|
||||
EXPOSE 8100 35729
|
||||
CMD ["build.sh"]
|
12
DynamicBibleIonic/docker-compose.yml
Normal file
12
DynamicBibleIonic/docker-compose.yml
Normal file
@ -0,0 +1,12 @@
|
||||
version: "3"
|
||||
services:
|
||||
web:
|
||||
image: dynamicbible:3.2.0
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: ./Dockerfile
|
||||
ports:
|
||||
- 8100:8100
|
||||
- 35729:35729
|
||||
volumes:
|
||||
- ./releases:/db/dynamicbible/DynamicBibleIonic/platforms/android/app/build/outputs/apk/release/
|
14
DynamicBibleIonic/docker/android-accept-licenses.sh
Normal file
14
DynamicBibleIonic/docker/android-accept-licenses.sh
Normal file
@ -0,0 +1,14 @@
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
set timeout 1800
|
||||
set cmd [lindex $argv 0]
|
||||
set licenses [lindex $argv 1]
|
||||
|
||||
spawn {*}$cmd
|
||||
expect {
|
||||
"Do you accept the license '*'*" {
|
||||
exp_send "y\r"
|
||||
exp_continue
|
||||
}
|
||||
eof
|
||||
}
|
6
DynamicBibleIonic/docker/build.sh
Normal file
6
DynamicBibleIonic/docker/build.sh
Normal file
@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
cd /db/dynamicbible/DynamicBibleIonic
|
||||
hg pull
|
||||
hg update main
|
||||
ionic serve
|
Loading…
x
Reference in New Issue
Block a user