-
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.
Merge branch 'master' of github.com:ethancedwards8/ethancedwards-quotes
- Loading branch information
Showing
7 changed files
with
52 additions
and
45 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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Docker Image CI | ||
|
||
on: | ||
push: | ||
branches: [ "master" ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Public to Registry | ||
uses: elgohr/Publish-Docker-Github-Action@v4 | ||
with: | ||
name: ethancedwards8/ethancedwards-api | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} |
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,5 +1,5 @@ | ||
FROM python:alpine | ||
|
||
COPY . /app | ||
RUN pip install flask flask-restful | ||
ENTRYPOINT ["python", "/app/ethancedwards_quotes.py"] | ||
RUN pip3 install flask flask-restful | ||
ENTRYPOINT ["python3", "/app/src/ethancedwards_api.py"] |
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,23 @@ | ||
#!/usr/bin/env python3 | ||
|
||
|
||
# Flask imports | ||
from flask import Flask | ||
from flask_restful import Api, Resource, reqparse | ||
|
||
# vanilla imports | ||
import os | ||
|
||
# imports for different modules | ||
from quotes.quotes import * | ||
|
||
app = Flask(__name__) | ||
api = Api(app) | ||
DEV = os.environ.get('DEV') | ||
|
||
# resources being added | ||
api.add_resource(Quote, "/quotes/v1", "/quotes/v1/", "/quotes/v1/<int:id>/") | ||
api.add_resource(Dump, "/quotes/v1/dump", "/quotes/v1/dump/") | ||
|
||
if __name__ == '__main__': | ||
app.run(host='0.0.0.0', port=(8000 if DEV else 80)) |
Binary file not shown.
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