Skip to content

Commit

Permalink
updated containers configuration to work with secure connection
Browse files Browse the repository at this point in the history
  • Loading branch information
Foroxon committed Dec 16, 2024
1 parent 6b2b284 commit 2dadb7d
Show file tree
Hide file tree
Showing 16 changed files with 39 additions and 304 deletions.
73 changes: 28 additions & 45 deletions .github/workflows/deploy_server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ on:
type: boolean
default: false
description: Redeploy all (be careful!)
# redeploy_tcp_sockets:
# type: boolean
# default: false
# description: TCP Sockets
redeploy_web_sockets:
type: boolean
default: false
Expand Down Expand Up @@ -48,26 +44,13 @@ jobs:
deploy_microservices:
runs-on: ubuntu-latest
steps:
# - name: Redeploy TCP Sockets
# if: ${{ inputs.redeploy_tcp_sockets || inputs.redeploy_all }}
# uses: appleboy/[email protected]
# with:
# host: ${{ secrets.GOOGLE_CLOUD_IP }}
# username: ${{ secrets.GOOGLE_CLOUD_SSH_USER }}
# key: ${{ secrets.GOOGLE_PRIVATE_SSH }}
# script: |
# cd /root/ukraine_alarm_map/deploy/
# git fetch --all
# git switch ${{ github.ref_name }}
# git pull
# bash redeploy_tcp_server.sh -m ${{ secrets.MEMCACHED_HOST }}
- name: Redeploy WebSockets
if: ${{ inputs.redeploy_web_sockets || inputs.redeploy_all }}
uses: appleboy/[email protected]
with:
host: ${{ secrets.GOOGLE_CLOUD_IP }}
username: ${{ secrets.GOOGLE_CLOUD_SSH_USER }}
key: ${{ secrets.GOOGLE_PRIVATE_SSH }}
host: ${{ secrets.CLOUD_SERVER_IP }}
username: ${{ secrets.CLOUD_SERVER_USER }}
key: ${{ secrets.CLOUD_SERVER_SSH_KEY }}
script: |
cd /root/ukraine_alarm_map/deploy/
git fetch --all
Expand All @@ -78,9 +61,9 @@ jobs:
if: ${{ inputs.redeploy_update_server || inputs.redeploy_all }}
uses: appleboy/[email protected]
with:
host: ${{ secrets.GOOGLE_CLOUD_IP }}
username: ${{ secrets.GOOGLE_CLOUD_SSH_USER }}
key: ${{ secrets.GOOGLE_PRIVATE_SSH }}
host: ${{ secrets.CLOUD_SERVER_IP }}
username: ${{ secrets.CLOUD_SERVER_USER }}
key: ${{ secrets.CLOUD_SERVER_SSH_KEY }}
script: |
cd /root/ukraine_alarm_map/deploy/
git fetch --all
Expand All @@ -91,22 +74,22 @@ jobs:
if: ${{ inputs.redeploy_web_server || inputs.redeploy_all }}
uses: appleboy/[email protected]
with:
host: ${{ secrets.GOOGLE_CLOUD_IP }}
username: ${{ secrets.GOOGLE_CLOUD_SSH_USER }}
key: ${{ secrets.GOOGLE_PRIVATE_SSH }}
host: ${{ secrets.CLOUD_SERVER_IP }}
username: ${{ secrets.CLOUD_SERVER_USER }}
key: ${{ secrets.CLOUD_SERVER_SSH_KEY }}
script: |
cd /root/ukraine_alarm_map/deploy/
git fetch --all
git switch ${{ github.ref_name }}
git pull
bash redeploy_web_server.sh -d ${{ secrets.WEB_TOKEN }} -p 80 -m ${{ secrets.MEMCACHED_HOST }}
bash redeploy_web_server.sh -d ${{ secrets.WEB_TOKEN }} -m ${{ secrets.MEMCACHED_HOST }}
- name: Redeploy Weather
if: ${{ inputs.redeploy_weather || inputs.redeploy_all }}
uses: appleboy/[email protected]
with:
host: ${{ secrets.GOOGLE_CLOUD_IP }}
username: ${{ secrets.GOOGLE_CLOUD_SSH_USER }}
key: ${{ secrets.GOOGLE_PRIVATE_SSH }}
host: ${{ secrets.CLOUD_SERVER_IP }}
username: ${{ secrets.CLOUD_SERVER_USER }}
key: ${{ secrets.CLOUD_SERVER_SSH_KEY }}
script: |
cd /root/ukraine_alarm_map/deploy/
git fetch --all
Expand All @@ -117,9 +100,9 @@ jobs:
if: ${{ inputs.redeploy_updater || inputs.redeploy_all }}
uses: appleboy/[email protected]
with:
host: ${{ secrets.GOOGLE_CLOUD_IP }}
username: ${{ secrets.GOOGLE_CLOUD_SSH_USER }}
key: ${{ secrets.GOOGLE_PRIVATE_SSH }}
host: ${{ secrets.CLOUD_SERVER_IP }}
username: ${{ secrets.CLOUD_SERVER_USER }}
key: ${{ secrets.CLOUD_SERVER_SSH_KEY }}
script: |
cd /root/ukraine_alarm_map/deploy/
git fetch --all
Expand All @@ -130,9 +113,9 @@ jobs:
if: ${{ inputs.redeploy_svg_generator || inputs.redeploy_all }}
uses: appleboy/[email protected]
with:
host: ${{ secrets.GOOGLE_CLOUD_IP }}
username: ${{ secrets.GOOGLE_CLOUD_SSH_USER }}
key: ${{ secrets.GOOGLE_PRIVATE_SSH }}
host: ${{ secrets.CLOUD_SERVER_IP }}
username: ${{ secrets.CLOUD_SERVER_USER }}
key: ${{ secrets.CLOUD_SERVER_SSH_KEY }}
script: |
cd /root/ukraine_alarm_map/deploy/
git fetch --all
Expand All @@ -143,9 +126,9 @@ jobs:
if: ${{ inputs.redeploy_etryvoga || inputs.redeploy_all }}
uses: appleboy/[email protected]
with:
host: ${{ secrets.GOOGLE_CLOUD_IP }}
username: ${{ secrets.GOOGLE_CLOUD_SSH_USER }}
key: ${{ secrets.GOOGLE_PRIVATE_SSH }}
host: ${{ secrets.CLOUD_SERVER_IP }}
username: ${{ secrets.CLOUD_SERVER_USER }}
key: ${{ secrets.CLOUD_SERVER_SSH_KEY }}
script: |
cd /root/ukraine_alarm_map/deploy/
git fetch --all
Expand All @@ -156,9 +139,9 @@ jobs:
if: ${{ inputs.redeploy_alerts || inputs.redeploy_all }}
uses: appleboy/[email protected]
with:
host: ${{ secrets.GOOGLE_CLOUD_IP }}
username: ${{ secrets.GOOGLE_CLOUD_SSH_USER }}
key: ${{ secrets.GOOGLE_PRIVATE_SSH }}
host: ${{ secrets.CLOUD_SERVER_IP }}
username: ${{ secrets.CLOUD_SERVER_USER }}
key: ${{ secrets.CLOUD_SERVER_SSH_KEY }}
script: |
cd /root/ukraine_alarm_map/deploy/
git fetch --all
Expand All @@ -168,8 +151,8 @@ jobs:
- name: Clear unused images
uses: appleboy/[email protected]
with:
host: ${{ secrets.GOOGLE_CLOUD_IP }}
username: ${{ secrets.GOOGLE_CLOUD_SSH_USER }}
key: ${{ secrets.GOOGLE_PRIVATE_SSH }}
host: ${{ secrets.CLOUD_SERVER_IP }}
username: ${{ secrets.CLOUD_SERVER_USER }}
key: ${{ secrets.CLOUD_SERVER_SSH_KEY }}
script: |
docker image prune -f
2 changes: 1 addition & 1 deletion deploy/redeploy_alerts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ docker rm map_alerts || true

# Deploying the new container
echo "Deploying new container..."
docker run --name map_alerts --restart unless-stopped -d --env ALERT_PERIOD="$ALERT_PERIOD" --env ALERT_TOKEN="$ALERT_TOKEN" --env MEMCACHED_HOST="$MEMCACHED_HOST" --env LOGGING="$LOGGING" map_alerts
docker run --name map_alerts --restart unless-stopped --network=jaam -d --env ALERT_PERIOD="$ALERT_PERIOD" --env ALERT_TOKEN="$ALERT_TOKEN" --env MEMCACHED_HOST="$MEMCACHED_HOST" --env LOGGING="$LOGGING" map_alerts

echo "Container deployed successfully!"

2 changes: 1 addition & 1 deletion deploy/redeploy_etryvoga.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ docker rm map_etryvoga || true

# Deploying the new container
echo "Deploying new container..."
docker run --name map_etryvoga --restart unless-stopped -d --env ETRYVOGA_HOST="$ETRYVOGA_HOST" --env ETRYVOGA_DISTRICTS_HOST="$ETRYVOGA_DISTRICTS_HOST" --env ETRYVOGA_PERIOD="$ETRYVOGA_PERIOD" --env ETRYVOGA_DISTRICTS_PERIOD="$ETRYVOGA_DISTRICTS_PERIOD" --env MEMCACHED_HOST="$MEMCACHED_HOST" --env LOGGING="$LOGGING" map_etryvoga
docker run --name map_etryvoga --restart unless-stopped --network=jaam -d --env ETRYVOGA_HOST="$ETRYVOGA_HOST" --env ETRYVOGA_DISTRICTS_HOST="$ETRYVOGA_DISTRICTS_HOST" --env ETRYVOGA_PERIOD="$ETRYVOGA_PERIOD" --env ETRYVOGA_DISTRICTS_PERIOD="$ETRYVOGA_DISTRICTS_PERIOD" --env MEMCACHED_HOST="$MEMCACHED_HOST" --env LOGGING="$LOGGING" map_etryvoga

echo "Container deployed successfully!"

2 changes: 1 addition & 1 deletion deploy/redeploy_svg_generator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ docker rm map_svg_generator || true

# Deploying the new container
echo "Deploying new container..."
docker run --name map_svg_generator --restart unless-stopped -d -v /shared_data:/shared_data --env MEMCACHED_HOST="$MEMCACHED_HOST" --env LOGGING="$LOGGING" map_svg_generator
docker run --name map_svg_generator --restart unless-stopped --network=jaam -d -v /shared_data:/shared_data --env MEMCACHED_HOST="$MEMCACHED_HOST" --env LOGGING="$LOGGING" map_svg_generator

echo "Container deployed successfully!"

60 changes: 0 additions & 60 deletions deploy/redeploy_tcp_server.sh

This file was deleted.

2 changes: 1 addition & 1 deletion deploy/redeploy_update_server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ docker rm map_update_server || true

# Deploying the new container
echo "Deploying new container..."
docker run --name map_update_server --restart unless-stopped -d -p "$PORT":"$PORT" -v "$SHARED_PATH":/shared_data -v "$SHARED_BETA_PATH":/shared_beta_data --env PORT="$PORT" --env MEMCACHED_HOST="$MEMCACHED_HOST" --env LOGGING="$LOGGING" map_update_server
docker run --name map_update_server --restart unless-stopped --network=jaam -d -v "$SHARED_PATH":/shared_data -v "$SHARED_BETA_PATH":/shared_beta_data --env PORT="$PORT" --env MEMCACHED_HOST="$MEMCACHED_HOST" --env LOGGING="$LOGGING" map_update_server

echo "Container deployed successfully!"

2 changes: 1 addition & 1 deletion deploy/redeploy_updater.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ docker rm map_updater || true

# Deploying the new container
echo "Deploying new container..."
docker run --name map_updater --restart unless-stopped -d --env UPDATER_PERIOD="$UPDATER_PERIOD" --env MEMCACHED_HOST="$MEMCACHED_HOST" --env LOGGING="$LOGGING" map_updater
docker run --name map_updater --restart unless-stopped --network=jaam -d --env UPDATER_PERIOD="$UPDATER_PERIOD" --env MEMCACHED_HOST="$MEMCACHED_HOST" --env LOGGING="$LOGGING" map_updater

echo "Container deployed successfully!"

2 changes: 1 addition & 1 deletion deploy/redeploy_weather.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ docker rm map_weather || true

# Deploying the new container
echo "Deploying new container..."
docker run --name map_weather --restart unless-stopped -d --env WEATHER_PERIOD="$WEATHER_PERIOD" --env WEATHER_TOKEN="$WEATHER_TOKEN" --env MEMCACHED_HOST="$MEMCACHED_HOST" --env LOGGING="$LOGGING" map_weather
docker run --name map_weather --restart unless-stopped --network=jaam -d --env WEATHER_PERIOD="$WEATHER_PERIOD" --env WEATHER_TOKEN="$WEATHER_TOKEN" --env MEMCACHED_HOST="$MEMCACHED_HOST" --env LOGGING="$LOGGING" map_weather

echo "Container deployed successfully!"

2 changes: 1 addition & 1 deletion deploy/redeploy_web_server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ docker rm map_web_server || true

# Deploying the new container
echo "Deploying new container..."
docker run --name map_web_server --restart unless-stopped -d -p "$PORT":8080 -v /shared_data:/shared_data --env DATA_TOKEN="$DATA_TOKEN" --env MEMCACHED_HOST="$MEMCACHED_HOST" --env LOGGING="$LOGGING" map_web_server
docker run --name map_web_server --restart unless-stopped --network=jaam -d -v /shared_data:/shared_data --env PORT="$PORT" --env DATA_TOKEN="$DATA_TOKEN" --env MEMCACHED_HOST="$MEMCACHED_HOST" --env LOGGING="$LOGGING" map_web_server

echo "Container deployed successfully!"

2 changes: 1 addition & 1 deletion deploy/redeploy_websocket_server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ docker rm map_websocket_server || true

# Deploying the new container
echo "Deploying new container..."
docker run --name map_websocket_server --restart unless-stopped -d -p "$WEBSOCKET_PORT":"$WEBSOCKET_PORT" --env WEBSOCKET_PORT="$WEBSOCKET_PORT" --env API_SECRET="$API_SECRET" --env MEASUREMENT_ID="$MEASUREMENT_ID" --env PING_INTERVAL="$PING_INTERVAL" --env MEMCACHED_HOST="$MEMCACHED_HOST" --env ENVIRONMENT="$ENVIRONMENT" --env LOGGING="$LOGGING" map_websocket_server
docker run --name map_websocket_server --restart unless-stopped --network=jaam -d --env WEBSOCKET_PORT="$WEBSOCKET_PORT" --env API_SECRET="$API_SECRET" --env MEASUREMENT_ID="$MEASUREMENT_ID" --env PING_INTERVAL="$PING_INTERVAL" --env MEMCACHED_HOST="$MEMCACHED_HOST" --env ENVIRONMENT="$ENVIRONMENT" --env LOGGING="$LOGGING" map_websocket_server

echo "Container deployed successfully!"

2 changes: 1 addition & 1 deletion deploy/redeploy_websocket_server_dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ docker rm map_websocket_server_dev || true

# Deploying the new container
echo "Deploying new container..."
docker run --name map_websocket_server_dev --restart unless-stopped -d -p "$WEBSOCKET_PORT":"$WEBSOCKET_PORT" --env WEBSOCKET_PORT="$WEBSOCKET_PORT" --env API_SECRET="$API_SECRET" --env MEASUREMENT_ID="$MEASUREMENT_ID" --env PING_INTERVAL="$PING_INTERVAL" --env MEMCACHED_HOST="$MEMCACHED_HOST" --env ENVIRONMENT="$ENVIRONMENT" --env RANDOM_MODE="$RANDOM_MODE" --env TEST_MODE="$TEST_MODE" --env MEMCACHE_FETCH_INTERVAL="$MEMCACHE_FETCH_INTERVAL" --env LOGGING="$LOGGING" map_websocket_server_dev
docker run --name map_websocket_server_dev --restart unless-stopped --network=jaam -d --env WEBSOCKET_PORT="$WEBSOCKET_PORT" --env API_SECRET="$API_SECRET" --env MEASUREMENT_ID="$MEASUREMENT_ID" --env PING_INTERVAL="$PING_INTERVAL" --env MEMCACHED_HOST="$MEMCACHED_HOST" --env ENVIRONMENT="$ENVIRONMENT" --env RANDOM_MODE="$RANDOM_MODE" --env TEST_MODE="$TEST_MODE" --env MEMCACHE_FETCH_INTERVAL="$MEMCACHE_FETCH_INTERVAL" --env LOGGING="$LOGGING" map_websocket_server_dev

echo "Container deployed successfully!"

7 changes: 0 additions & 7 deletions deploy/tcp_server/Dockerfile

This file was deleted.

Binary file removed deploy/tcp_server/GeoLite2-City.mmdb
Binary file not shown.
3 changes: 0 additions & 3 deletions deploy/tcp_server/requirements.txt

This file was deleted.

Loading

0 comments on commit 2dadb7d

Please sign in to comment.