-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathDockerfile
More file actions
80 lines (63 loc) · 2.61 KB
/
Copy pathDockerfile
File metadata and controls
80 lines (63 loc) · 2.61 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
69
70
71
72
73
74
75
76
77
78
79
80
#######################################
# Multi-stage Dockerfile
# 1. Set up the build environment
# 2. Build Edirom-Online packages
# 3. Run the nginx and deploy frontend
#######################################
#########################
# 1. Build Environment
#########################
FROM eclipse-temurin:8-jdk-focal as builder
ARG ANT_VERSION=1.10.12
ARG BE_PORT=8080
ARG SENCHA_BUILD_ENV=production
# Install wget and unzip and ruby and other dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
sudo \
wget \
git \
unzip \
libfreetype6 \
fontconfig \
ruby-full \
&& rm -rf /var/lib/apt/lists/*
# Download and extract Apache Ant to opt folder
RUN wget --no-check-certificate --no-cookies http://archive.apache.org/dist/ant/binaries/apache-ant-${ANT_VERSION}-bin.tar.gz && \
wget --no-check-certificate --no-cookies http://archive.apache.org/dist/ant/binaries/apache-ant-${ANT_VERSION}-bin.tar.gz.sha512 && \
echo "$(cat apache-ant-${ANT_VERSION}-bin.tar.gz.sha512) apache-ant-${ANT_VERSION}-bin.tar.gz" | sha512sum -c && \
tar -zvxf apache-ant-${ANT_VERSION}-bin.tar.gz -C /opt/ && \
ln -s /opt/apache-ant-${ANT_VERSION} /opt/ant && \
unlink apache-ant-${ANT_VERSION}-bin.tar.gz && \
unlink apache-ant-${ANT_VERSION}-bin.tar.gz.sha512
# Download and install SenchaCmd Community Edition
RUN curl --silent http://cdn.sencha.com/cmd/7.0.0.40/no-jre/SenchaCmd-7.0.0.40-linux-amd64.sh.zip -o /tmp/senchaCmd.zip && \
unzip /tmp/senchaCmd.zip -d /tmp && \
unlink /tmp/senchaCmd.zip && \
chmod o+x /tmp/SenchaCmd-7.0.0.40-linux-amd64.sh && \
/tmp/SenchaCmd-7.0.0.40-linux-amd64.sh -Dall=true -q -dir /opt/Sencha/Cmd/7.0.0.40 && \
unlink /tmp/SenchaCmd-7.0.0.40-linux-amd64.sh
# Put ant and sencha in the path
ENV PATH="/opt/ant/bin:/opt/Sencha/Cmd:${PATH}"
############################
# 2. Edirom-Online Frontend
############################
# Get build for Edirom-Online Frontend
WORKDIR /opt/eo-frontend
COPY . .
RUN echo "Writing backend.port=$BE_PORT to local.properties…"; \
if [ -f "./local.properties" ]; then \
sed -i '/^backend\.port=/d' local.properties; \
echo "backend.port=$BE_PORT" >> local.properties; \
else \
echo "backend.port=$BE_PORT" >> local.properties; \
fi && \
echo "Building Frontend XAR..." && \
sencha app build ${SENCHA_BUILD_ENV}
#########################
# 3. Run/deploy nginx
#########################
# Use nginx as the base image
FROM nginx:alpine
# copy build files to directory
COPY --from=builder /opt/eo-frontend/build/ /usr/share/nginx/html/