Skip to content

Commit

Permalink
Optimize nginx reloading usage v2
Browse files Browse the repository at this point in the history
  • Loading branch information
std-025-02 committed Sep 3, 2024
1 parent 096d9ac commit 4baa069
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 60 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/deploy-atleta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,15 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: "recursive"

- name: Create Image Tarball for Explorer
run: |
docker build -t sportchain-explorer -f docker/Dockerfile .
docker save -o sportchain-explorer.tar sportchain-explorer
mkdir -p artifacts/
mv sportchain-explorer.tar artifacts/
docker build --tag sportchain-explorer --file docker/Dockerfile .
docker save --output artifacts/sportchain-explorer.tar sportchain-explorer
- name: Set up SSH
run: |
Expand All @@ -43,5 +42,5 @@ jobs:
key: ${{ secrets.EXPLORER_PRIVATE_KEY }}
script: |
cd /sportchain
docker load -i sportchain-explorer.tar
docker compose up -d
docker load --input sportchain-explorer.tar
docker compose up --detach
5 changes: 2 additions & 3 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,12 @@ RUN apk add --no-cache bash; chmod +x env.sh
COPY docker/nginx /etc/nginx
COPY --from=builder /apps/packages/apps/build /usr/share/nginx/html

COPY docker/nginx-container/docker-entrypoint.sh /
COPY docker/nginx-container/check_ssl.sh /

ENTRYPOINT ["/docker-entrypoint.sh"]
ENTRYPOINT ["/bin/bash", "-c"]

EXPOSE 80

STOPSIGNAL SIGQUIT

CMD ["/bin/bash", "-c", "/usr/share/nginx/html/env.sh && nginx -g \"daemon off;\""]
CMD ["/check_ssl.sh & /usr/share/nginx/html/env.sh && exec /docker-entrypoint.sh nginx -g 'daemon off;'"]
3 changes: 1 addition & 2 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ services:
volumes:
- ./nginx/ssl:/etc/nginx/ssl:ro
- ./certbot/www:/var/www/certbot:ro
command: /bin/bash -c "/usr/share/nginx/html/env.sh && nginx -g 'daemon off;' & /check_ssl.sh"

ports:
- "0.0.0.0:80:80"
Expand All @@ -22,7 +21,7 @@ services:
certbot:
image: certbot/certbot:v2.10.0
container_name: sportchain-explorer-certbot
restart: unless-stopped
restart: always
volumes:
- ./nginx/ssl:/etc/letsencrypt:rw
- ./certbot/www:/var/www/certbot:rw
Expand Down
49 changes: 0 additions & 49 deletions docker/nginx-container/docker-entrypoint.sh

This file was deleted.

0 comments on commit 4baa069

Please sign in to comment.