mirror of
https://github.com/Alvin-Zilverstand/novatorem.git
synced 2026-03-06 02:57:12 +01:00
Added support for Docker
- Updated SetUp.md with a "Run locally with Docker" section - Moved requirements.txt to the root of the repo since some hosting services require the file to be there (eg. Heroku https://elements.heroku.com/buildpacks/heroku/heroku-buildpack-python)
This commit is contained in:
committed by
Andrew Novac
parent
0bf396a69f
commit
02b606b543
2
.dockerignore
Normal file
2
.dockerignore
Normal file
@@ -0,0 +1,2 @@
|
||||
.dockerignore
|
||||
Dockerfile
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -2,4 +2,4 @@
|
||||
.DS_Store
|
||||
|
||||
# Environment variables
|
||||
.env
|
||||
.env
|
||||
|
||||
12
Dockerfile
Normal file
12
Dockerfile
Normal file
@@ -0,0 +1,12 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
FROM python:latest
|
||||
|
||||
WORKDIR /api
|
||||
|
||||
COPY requirements.txt requirements.txt
|
||||
RUN pip3 install -r requirements.txt
|
||||
|
||||
COPY api/ .
|
||||
|
||||
CMD [ "python3", "spotify.py"]
|
||||
22
SetUp.md
22
SetUp.md
@@ -43,6 +43,28 @@ curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -H "Authorizat
|
||||
|
||||
* Deploy!
|
||||
|
||||
## Run locally with Docker
|
||||
|
||||
* You need to have [Docker](https://docs.docker.com/get-docker/) installed.
|
||||
|
||||
* Add Environment Variables:
|
||||
* `SPOTIFY_REFRESH_TOKEN`
|
||||
* `SPOTIFY_CLIENT_ID`
|
||||
* `SPOTIFY_SECRET_ID`
|
||||
|
||||
* To run the service, open a terminal in the root folder of the repo: <br>
|
||||
Execute:
|
||||
```
|
||||
docker compose up
|
||||
```
|
||||
* When finished, navigate to [http://localhost:5000/](http://localhost:5000/)
|
||||
|
||||
* To stop the service, open a terminal in the root folder of the repo: <br>
|
||||
Execute:
|
||||
```
|
||||
docker compose down
|
||||
```
|
||||
|
||||
## ReadMe
|
||||
|
||||
You can now use the following in your readme:
|
||||
|
||||
@@ -153,4 +153,4 @@ def catch_all(path):
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run(debug=True)
|
||||
app.run(host="0.0.0.0", debug=True)
|
||||
|
||||
10
docker-compose.yml
Normal file
10
docker-compose.yml
Normal file
@@ -0,0 +1,10 @@
|
||||
version: '3.8'
|
||||
services:
|
||||
spotify-readme:
|
||||
build: .
|
||||
ports:
|
||||
- "5000:5000"
|
||||
volumes:
|
||||
- ./api:/api
|
||||
volumes:
|
||||
persistent:
|
||||
Reference in New Issue
Block a user