-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[infra] - deploy config with nginx implemented
- Loading branch information
1 parent
6745244
commit df57f67
Showing
27 changed files
with
221 additions
and
169 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,32 @@ | ||
name: Continuos Delivery - CD | ||
|
||
on: | ||
workflow_run: | ||
workflows: ["Continuos Integration - CI"] | ||
types: | ||
- completed | ||
# workflow_run: | ||
# workflows: ["Continuos Integration - CI"] | ||
# types: | ||
# - requested | ||
workflow_dispatch: | ||
|
||
jobs: | ||
aws: | ||
runs-on: self-hosted | ||
|
||
steps: | ||
# Running API Container | ||
- name: Pull Docker Image (API) | ||
run: | | ||
sudo docker image rm -f davilucciola/knockbank-api | ||
sudo docker pull davilucciola/knockbank-api:latest | ||
# steps: | ||
# # Running API Container | ||
# - name: Pull Docker Image (API) | ||
# run: | | ||
# sudo docker image rm -f davilucciola/knockbank-api | ||
# sudo docker pull davilucciola/knockbank-api:latest | ||
|
||
- name: Delete Old Container (API) | ||
run: sudo docker rm -f knockbank-api || true | ||
# - name: Delete Old Container (API) | ||
# run: sudo docker rm -f knockbank-api || true | ||
|
||
- name: Run Docker Container (API) | ||
env: | ||
TOKEN_SECRET: ${{ secrets.TOKEN_SECRET }} | ||
SQLALCHEMY_DATABASE_URI: ${{ secrets.SQLALCHEMY_DATABASE_URI }} | ||
run: | | ||
sudo docker run --name knockbank-api -p 5000:5000 --restart=always \ | ||
-e TOKEN_SECRET=$TOKEN_SECRET \ | ||
-e SQLALCHEMY_DATABASE_URI=$SQLALCHEMY_DATABASE_URI \ | ||
-d davilucciola/knockbank-api | ||
# - name: Run Docker Container (API) | ||
# env: | ||
# TOKEN_SECRET: ${{ secrets.TOKEN_SECRET }} | ||
# SQLALCHEMY_DATABASE_URI: ${{ secrets.SQLALCHEMY_DATABASE_URI }} | ||
# run: | | ||
# sudo docker run --name knockbank-api -p 5000:5000 --restart=always \ | ||
# -e TOKEN_SECRET=$TOKEN_SECRET \ | ||
# -e SQLALCHEMY_DATABASE_URI=$SQLALCHEMY_DATABASE_URI \ | ||
# -d davilucciola/knockbank-api |
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 was deleted.
Oops, something went wrong.
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,4 @@ | ||
FROM nginx:alpine | ||
RUN rm /etc/nginx/conf.d/default.conf | ||
WORKDIR /etc/nginx/conf.d/ | ||
COPY ./nginx.conf /etc/nginx/conf.d/ |
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,29 @@ | ||
upstream knockbank-api { | ||
server api:5000; | ||
} | ||
|
||
upstream knockbank-web { | ||
server web:3000; | ||
} | ||
|
||
server { | ||
listen 80; | ||
|
||
location / { | ||
proxy_pass http://knockbank-web; | ||
proxy_http_version 1.1; | ||
proxy_set_header Host $host; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection 'Upgrade'; | ||
proxy_cache_bypass $http_upgrade; | ||
} | ||
|
||
location /api { | ||
proxy_pass http://knockbank-api; | ||
proxy_http_version 1.1; | ||
proxy_set_header Host $host; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection 'Upgrade'; | ||
proxy_cache_bypass $http_upgrade; | ||
} | ||
} |
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
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
Oops, something went wrong.