Skip to content

Commit

Permalink
remove wait lib
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-du-car committed Mar 27, 2024
1 parent 685c08b commit 2335bb0
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 68 deletions.
22 changes: 1 addition & 21 deletions .github/workflows/dockerhub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -225,24 +225,4 @@ jobs:
context: ./telematic_system/telematic_cloud_messaging/
file: ./telematic_system/telematic_cloud_messaging/local.Dockerfile
push: true
tags: usdotfhwastoldev/telematic_local_messaging:${{ github.ref_name }}

dockerhub-telematic-local-web-server:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build
uses: docker/build-push-action@v3
with:
context: ./telematic_system/telematic_apps/web_app/server
file: ./telematic_system/telematic_apps/web_app/server/local.Dockerfile
push: true
tags: usdotfhwastoldev/telematic_local_web_server:${{ github.ref_name }}
tags: usdotfhwastoldev/telematic_local_messaging:${{ github.ref_name }}
1 change: 1 addition & 0 deletions telematic_system/docker-compose.cloud.servers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ services:
max-size: "2g"
max-file: "1"
network_mode: host
command: bash -c 'wait-for-it localhost:4222 && java -jar /telematic_cloud_messaging/app.jar'
environment:
- NATS_URI=nats://localhost:4222
22 changes: 9 additions & 13 deletions telematic_system/docker-compose.local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ services:
image: mysql:5.7
restart: always
container_name: mysqldb
logging:
options:
max-size: "10m"
max-file: "1"
environment:
- MYSQL_DATABASE=${MYSQL_DATABASE}
- MYSQL_USER=${MYSQL_USER}
Expand Down Expand Up @@ -76,8 +80,8 @@ services:
web_server:
build:
context: "./telematic_apps/web_app/server"
dockerfile: "local.Dockerfile"
image: usdotfhwastoldev/telematic_local_web_server:develop
dockerfile: "Dockerfile"
image: usdotfhwastoldev/telematic_web_server:develop
restart: always
container_name: web_server
logging:
Expand All @@ -89,10 +93,6 @@ services:
- mysqldb
- grafana
environment:
- WAIT_HOSTS=localhost:3307,localhost:3000
- WAIT_TIMEOUT=300
- WAIT_SLEEP_INTERVAL=5
- WAIT_HOST_CONNECT_TIMEOUT=30
- NODE_ENV=dev.comelopment
- CHOKIDAR_USEPOLLING=true
- ALLOW_CLIENT_URL=http://local.cav-telematics.com:8888
Expand Down Expand Up @@ -120,7 +120,8 @@ services:
- CONCURRENT_QUEUE_SIZE=5
- PART_SIZE=10485760
- NATS_SERVERS=localhost:4222
- FILE_PROCESSING_SUBJECT=ui.file.processing
- FILE_PROCESSING_SUBJECT=ui.file.processing
command: bash -c 'wait-for-it localhost:3307 && wait-for-it localhost:3000 && /app/service.sh'
volumes:
- /opt/apache2/grafana_htpasswd:/opt/apache2/grafana_htpasswd
- /opt/telematics/upload:/opt/telematics/upload
Expand Down Expand Up @@ -180,12 +181,7 @@ services:
max-size: "2g"
max-file: "1"
network_mode: host
environment:
- NATS_URI=nats://localhost:4222
- WAIT_HOSTS=localhost:3307,localhost:4222,localhost:8086
- WAIT_TIMEOUT=300
- WAIT_SLEEP_INTERVAL=5
- WAIT_HOST_CONNECT_TIMEOUT=30
command: bash -c 'java -jar /telematic_cloud_messaging/app.jar'

rosbag2_processing_service:
build:
Expand Down
1 change: 1 addition & 0 deletions telematic_system/docker-compose.webapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ services:
- PART_SIZE=10485760
- NATS_SERVERS=<NATS_IP>:4222
- FILE_PROCESSING_SUBJECT=ui.file.processing
command: bash -c '/app/service.sh'
volumes:
- /opt/apache2/grafana_htpasswd:/opt/apache2/grafana_htpasswd
- /opt/telematics/upload:/opt/telematics/upload
Expand Down
5 changes: 2 additions & 3 deletions telematic_system/telematic_apps/web_app/server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ WORKDIR /app
COPY package*.json ./

RUN npm install -g nodemon
RUN npm install -g node-wait-for-it
RUN npm init -y
RUN npm install

# Bundle app source
COPY . .
RUN chmod +x service.sh

CMD ./service.sh
RUN chmod +x service.sh
22 changes: 0 additions & 22 deletions telematic_system/telematic_apps/web_app/server/local.Dockerfile

This file was deleted.

4 changes: 2 additions & 2 deletions telematic_system/telematic_cloud_messaging/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ COPY ./ /telematic_cloud_messaging/
RUN ./mvnw clean package -Dmaven.test.skip=true
RUN mv /telematic_cloud_messaging/target/*.jar app.jar
RUN rm -R target
EXPOSE 8080
ENTRYPOINT ["java", "-jar", "/telematic_cloud_messaging/app.jar" ]
RUN apt update && apt install wait-for-it
EXPOSE 8080
8 changes: 1 addition & 7 deletions telematic_system/telematic_cloud_messaging/local.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,5 @@ RUN mv /telematic_cloud_messaging/src/main/resources/application.local.propertie
RUN ./mvnw clean package -Dmaven.test.skip=true
RUN mv /telematic_cloud_messaging/target/*.jar app.jar
RUN rm -R target
RUN apt update && apt install wait-for-it
EXPOSE 8080

# Add docker-compose-wait tool -------------------
ENV WAIT_VERSION 2.12.1
ADD https://github.com/ufoscout/docker-compose-wait/releases/download/$WAIT_VERSION/wait /wait
RUN chmod +x /wait

ENTRYPOINT ["/bin/sh", "-c", "/wait && java -jar /telematic_cloud_messaging/app.jar"]

0 comments on commit 2335bb0

Please sign in to comment.