forked from OneBusAway/onebusaway-application-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
88 lines (73 loc) · 3.18 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
#
# Copyright (C) 2024 Open Transit Software Foundation <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
FROM tomcat:8.5.100-jdk11-temurin
ARG MAVEN_VERSION=3.9.9
ARG OBA_VERSION=2.5.13-otsf
ENV OBA_VERSION=$OBA_VERSION
ENV CATALINA_HOME="/usr/local/tomcat"
ENV CATALINA_OPTS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005"
ENV TZ="America/Los_Angeles"
ENV MAVEN_HOME="/usr/share/maven"
ENV MAVEN_CONFIG="/root/.m2"
ENV GTFS_URL="https://www.soundtransit.org/GTFS-KCM/google_transit.zip"
ENV PATH="/oba:${PATH}"
# Install additional necessary tools
RUN apt-get update && apt-get install -y \
curl \
git \
jq \
python3-pip \
supervisor \
tzdata \
unzip \
unzip \
vim \
xmlstarlet \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Install Maven
RUN mkdir -p /usr/share/maven /usr/share/maven/ref && \
curl -fsSL -o /tmp/apache-maven.tar.gz https://downloads.apache.org/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz && \
tar -xzf /tmp/apache-maven.tar.gz -C /usr/share/maven --strip-components=1 && \
rm -f /tmp/apache-maven.tar.gz && \
ln -s /usr/share/maven/bin/mvn /usr/bin/mvn
RUN mkdir -p /root/.m2/repository
# Set up bundle builder
WORKDIR /oba
COPY ./docker_app_server/bundle_builder/build_bundle.sh .
COPY ./docker_app_server/copy_resources.sh .
# Set the configured time zone
RUN ln -fs /usr/share/zoneinfo/$TZ /etc/localtime && dpkg-reconfigure -f noninteractive tzdata
# Set up the host-manager and manager webapps
RUN rm -rf $CATALINA_HOME/webapps
RUN mv $CATALINA_HOME/webapps.dist $CATALINA_HOME/webapps
COPY ./docker_app_server/config/tomcat-users.xml $CATALINA_HOME/conf/
COPY ./docker_app_server/config/host-manager_context.xml $CATALINA_HOME/webapps/docs/META-INF/context.xml
COPY ./docker_app_server/config/host-manager_context.xml $CATALINA_HOME/webapps/examples/META-INF/context.xml
COPY ./docker_app_server/config/host-manager_context.xml $CATALINA_HOME/webapps/host-manager/META-INF/context.xml
COPY ./docker_app_server/config/host-manager_context.xml $CATALINA_HOME/webapps/manager/META-INF/context.xml
COPY ./docker_app_server/config/host-manager_context.xml $CATALINA_HOME/webapps/ROOT/META-INF/context.xml
# MySQL Connector
WORKDIR $CATALINA_HOME/lib
RUN wget "https://cdn.mysql.com/Downloads/Connector-J/mysql-connector-j-8.4.0.tar.gz" \
&& tar -zxvf mysql-connector-j-8.4.0.tar.gz \
&& mv mysql-connector-j-8.4.0/mysql-connector-j-8.4.0.jar . \
&& rm mysql-connector-j-8.4.0.tar.gz \
&& rm -rf mysql-connector-j-8.4.0
# Put the user in the source code directory when they shell in
WORKDIR /src
# Expose an additional port for debugging
EXPOSE 5005