Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PostgreSQL support added. #56

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file removed bundle/.gitkeep
Empty file.
28 changes: 22 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,44 @@ services:
environment:
- GTFS_URL

oba_database:
oba_database_mysql:
image: mysql:8.3
container_name: oba_database
container_name: oba_database_mysql
environment:
MYSQL_ROOT_PASSWORD: Ins3cure!
MYSQL_DATABASE: oba_database
MYSQL_USER: oba_user
MYSQL_PASSWORD: oba_password
ports:
- "3306:3306"
- "3307:3306"
volumes:
- type: volume
source: mysql-data
target: /var/lib/mysql
restart: always

oba_database_postgres:
image: postgres:13
container_name: oba_database_postgres
environment:
POSTGRES_DB: oba_database
POSTGRES_USER: oba_user
POSTGRES_PASSWORD: oba_password
ports:
- "5432:5432"
volumes:
- type: volume
source: postgres-data
target: /var/lib/postgresql/data
restart: always

oba_app:
container_name: oba_app
depends_on:
- oba_database
- oba_database_postgres
build: ./oba
environment:
- JDBC_URL=jdbc:mysql://oba_database:3306/oba_database
- JDBC_URL=jdbc:postgresql://oba_database_postgres:5432/oba_database
- JDBC_USER=oba_user
- JDBC_PASSWORD=oba_password
volumes:
Expand All @@ -44,4 +59,5 @@ services:
# restart: always

volumes:
mysql-data:
mysql-data:
postgres-data:
15 changes: 14 additions & 1 deletion oba/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@ FROM tomcat:8.5.98-jdk11-temurin
ENV CATALINA_HOME /usr/local/tomcat
ARG OBA_VERSION=2.4.18-cs

ARG GID=1000
ARG UID=1000
ARG GROUP=oba_group
ARG USER=oba_user

RUN groupadd -g $GID $GROUP && \
useradd -d /home/$USER -u $UID -m -s /bin/bash -g $GROUP $USER && \
chown -R $USER:$GROUP $CATALINA_HOME && \
mkdir -p /var/log/tomcat8 && \
chown -R $USER:$GROUP /var/log/tomcat8

USER $USER

# MySQL Connector
WORKDIR $CATALINA_HOME/lib
RUN wget "https://cdn.mysql.com/Downloads/Connector-J/mysql-connector-j-8.3.0.tar.gz" \
Expand Down Expand Up @@ -42,4 +55,4 @@ RUN jar xvf onebusaway-enterprise-acta-webapp-${OBA_VERSION}.war
RUN rm onebusaway-enterprise-acta-webapp-${OBA_VERSION}.war
COPY ./config/onebusaway-enterprise-acta-webapp-data-sources.xml ./WEB-INF/classes/data-sources.xml
RUN cp $CATALINA_HOME/lib/mysql-connector-j-8.3.0.jar ./WEB-INF/lib
RUN mv /oba/webapps/onebusaway-enterprise-acta-webapp $CATALINA_HOME/webapps
RUN mv /oba/webapps/onebusaway-enterprise-acta-webapp $CATALINA_HOME/webapps
Loading