File tree Expand file tree Collapse file tree 5 files changed +118
-1
lines changed Expand file tree Collapse file tree 5 files changed +118
-1
lines changed Original file line number Diff line number Diff line change
1
+ name : Docker Build & Push and Deploy to dev for score-backend
2
+
3
+ on :
4
+ push :
5
+ branches : [master]
6
+ workflow_dispatch :
7
+
8
+ jobs :
9
+ path-context :
10
+ runs-on : ubuntu-latest
11
+ steps :
12
+ - name : Checkout
13
+ uses : actions/checkout@v2
14
+ - name : Set up Docker Buildx
15
+ uses : docker/setup-buildx-action@v1
16
+ - name : Login to DockerHub
17
+ uses : docker/login-action@v1
18
+ with :
19
+ username : ${{ secrets.DOCKER_USERNAME }}
20
+ password : ${{ secrets.DOCKER_PASSWORD }}
21
+ - name : Get SHA
22
+ id : vars
23
+ run : echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
24
+ - name : Docker Build & Push
25
+ uses : docker/build-push-action@v2
26
+ with :
27
+ context : ./
28
+ file : ./Dockerfile
29
+ push : true
30
+ tags : cornellappdev/score-dev:${{ steps.vars.outputs.sha_short }}
31
+ - name : Remote SSH and Deploy
32
+ uses : appleboy/ssh-action@master
33
+ env :
34
+ IMAGE_TAG : ${{ steps.vars.outputs.sha_short }}
35
+ with :
36
+ host : ${{ secrets.DEV_SERVER_HOST }}
37
+ username : ${{ secrets.SERVER_USERNAME }}
38
+ key : ${{ secrets.DEV_SERVER_KEY }}
39
+ script : |
40
+ export IMAGE_TAG=${{ steps.vars.outputs.sha_short }}
41
+ cd docker-compose
42
+ docker stack rm thestack
43
+ sleep 20s
44
+ docker stack deploy -c docker-compose.yml thestack
45
+ docker system prune -a
Original file line number Diff line number Diff line change
1
+ name : Docker Build & Push and Deploy to prod for score-backend
2
+
3
+ on :
4
+ push :
5
+ branches : [release]
6
+ workflow_dispatch :
7
+
8
+ jobs :
9
+ path-context :
10
+ runs-on : ubuntu-latest
11
+ steps :
12
+ - name : Checkout
13
+ uses : actions/checkout@v2
14
+ - name : Set up Docker Buildx
15
+ uses : docker/setup-buildx-action@v1
16
+ - name : Login to DockerHub
17
+ uses : docker/login-action@v1
18
+ with :
19
+ username : ${{ secrets.DOCKER_USERNAME }}
20
+ password : ${{ secrets.DOCKER_PASSWORD }}
21
+ - name : Get SHA
22
+ id : vars
23
+ run : echo "::set-output name=sha_short::$(git rev-parse --short release)"
24
+ - name : Docker Build & Push
25
+ uses : docker/build-push-action@v2
26
+ with :
27
+ context : ./
28
+ file : ./Dockerfile
29
+ push : true
30
+ tags : cornellappdev/score:${{ steps.vars.outputs.sha_short }}
31
+ - name : Remote SSH and Deploy
32
+ uses : appleboy/ssh-action@master
33
+ env :
34
+ IMAGE_TAG : ${{ steps.vars.outputs.sha_short }}
35
+ with :
36
+ host : ${{ secrets.PROD_SERVER_HOST }}
37
+ username : ${{ secrets.SERVER_USERNAME }}
38
+ key : ${{ secrets.PROD_SERVER_KEY }}
39
+ script : |
40
+ export IMAGE_TAG=${{ steps.vars.outputs.sha_short }}
41
+ cd docker-compose
42
+ docker stack rm thestack
43
+ sleep 20s
44
+ docker stack deploy -c docker-compose.yml thestack
45
+ docker system prune -a
Original file line number Diff line number Diff line change
1
+ FROM python:3.9
2
+ RUN mkdir -p /usr/src/app
3
+ WORKDIR /usr/src/app
4
+ COPY . .
5
+ RUN pip3 install --upgrade pip
6
+ RUN pip install -r requirements.txt
7
+ CMD python app.py
Original file line number Diff line number Diff line change
1
+ version : " 3.6"
2
+
3
+ services :
4
+ web :
5
+ build : .
6
+ container_name : web
7
+ ports :
8
+ - " 5000:5000"
9
+ env_file :
10
+ - .env
11
+ environment :
12
+ - MONGO_URI=${ATLAS_URI}
13
+ - DB_NAME=${DB_NAME}
14
+ networks :
15
+ - app-network
16
+
17
+ networks :
18
+ app-network :
19
+ driver : bridge
Original file line number Diff line number Diff line change 4
4
pymongo
5
5
beautifulsoup4
6
6
requests
7
- pillow
7
+ pillow
8
+ Flask-APScheduler
You can’t perform that action at this time.
0 commit comments