-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #372 from OneBusAway/docker-app-server
Get OBA working in Docker
- Loading branch information
Showing
18 changed files
with
806 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# | ||
# Copyright (C) 2024 Open Transit Software Foundation <info@onebusaway.org> | ||
# | ||
# 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.98-jdk11-temurin | ||
|
||
ENV CATALINA_HOME /usr/local/tomcat | ||
ENV TZ=America/Los_Angeles | ||
ARG OBA_VERSION=2.5.13-otsf | ||
ENV OBA_VERSION=$OBA_VERSION | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
jq \ | ||
supervisor \ | ||
tzdata \ | ||
unzip \ | ||
xmlstarlet \ | ||
python3-pip \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# 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 ./config/tomcat-users.xml $CATALINA_HOME/conf/ | ||
|
||
COPY ./config/host-manager_context.xml $CATALINA_HOME/webapps/docs/META-INF/context.xml | ||
COPY ./config/host-manager_context.xml $CATALINA_HOME/webapps/examples/META-INF/context.xml | ||
COPY ./config/host-manager_context.xml $CATALINA_HOME/webapps/host-manager/META-INF/context.xml | ||
COPY ./config/host-manager_context.xml $CATALINA_HOME/webapps/manager/META-INF/context.xml | ||
COPY ./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 | ||
|
||
COPY ./copy_resources.sh /usr/local/bin/copy_resources.sh | ||
RUN chmod +x /usr/local/bin/copy_resources.sh |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# | ||
# Copyright (C) 2024 Open Transit Software Foundation <info@onebusaway.org> | ||
# | ||
# 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.98-jdk11-temurin | ||
|
||
ARG OBA_VERSION=2.5.13-otsf | ||
ENV OBA_VERSION_ENV=$OBA_VERSION | ||
|
||
# Start configuring OBA | ||
WORKDIR /oba | ||
|
||
COPY ./build_bundle.sh . | ||
|
||
CMD /oba/build_bundle.sh ${OBA_VERSION_ENV} | ||
|
||
# for debugging | ||
# CMD ["tail", "-f", "/dev/null"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/bin/bash | ||
|
||
# | ||
# Copyright (C) 2024 Open Transit Software Foundation <info@onebusaway.org> | ||
# | ||
# 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. | ||
# | ||
|
||
OBA_VERSION="$@" | ||
|
||
# If GTFS_URL is not set or is empty, then use a default value: | ||
RESOLVED_GTFS_URL=${GTFS_URL:-https://unitrans.ucdavis.edu/media/gtfs/Unitrans_GTFS.zip} | ||
|
||
echo "OBA Bundle Builder Starting" | ||
echo "GTFS_URL: $GTFS_URL" | ||
echo "Resolved GTFS_URL: $RESOLVED_GTFS_URL" | ||
echo "OBA Version: $OBA_VERSION" | ||
|
||
wget -O /bundle/gtfs.zip ${RESOLVED_GTFS_URL} | ||
|
||
# The JAR must be executed from within the same directory | ||
# as the bundle, or else some necessary files are not generated. | ||
|
||
cp /root/.m2/repository/org/onebusaway/onebusaway-transit-data-federation-builder/$OBA_VERSION/onebusaway-transit-data-federation-builder-$OBA_VERSION-withAllDependencies.jar /oba/builder.jar | ||
|
||
cd /bundle \ | ||
&& java -Xss4m -Xmx3g \ | ||
-jar /oba/builder.jar \ | ||
./gtfs.zip \ | ||
. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (C) 2012 Brian Ferris <bdferris@onebusaway.org> | ||
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. | ||
--> | ||
<!-- The contents of this file will be loaded for each web application --> | ||
<Context> | ||
|
||
<!-- Default set of monitored resources. If one of these changes, the --> | ||
<!-- web application will be reloaded. --> | ||
<WatchedResource>WEB-INF/web.xml</WatchedResource> | ||
<WatchedResource>/usr/local/tomcat/conf/web.xml</WatchedResource> | ||
|
||
<!-- Uncomment this to disable session persistence across Tomcat restarts --> | ||
<!-- | ||
<Manager pathname="" /> | ||
--> | ||
<Resource name="jdbc/appDB" | ||
auth="Container" | ||
type="javax.sql.DataSource" | ||
maxTotal="100" | ||
maxIdle="30" | ||
maxWaitMillis="10000" | ||
username="oba_user" | ||
password="oba_password" | ||
driverClassName="com.mysql.cj.jdbc.Driver" | ||
url="jdbc:mysql://database:3306/oba_database"/> | ||
</Context> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (C) 2012 Brian Ferris <bdferris@onebusaway.org> | ||
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. | ||
--> | ||
<Context antiResourceLocking="false" privileged="true" > | ||
<CookieProcessor className="org.apache.tomcat.util.http.Rfc6265CookieProcessor" | ||
sameSiteCookies="strict" /> | ||
<Manager sessionAttributeValueClassNameFilter="java\.lang\.(?:Boolean|Integer|Long|Number|String)|org\.apache\.catalina\.filters\.CsrfPreventionFilter\$LruCache(?:\$1)?|java\.util\.(?:Linked)?HashMap"/> | ||
</Context> |
Oops, something went wrong.