Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't be used when deployed to heroku #4

Open
wants to merge 17 commits into
base: DS-Ger
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ spacy = "*"
flask = "*"
flask-sqlalchemy = "*"
spotipy = "*"
scikit-learn = {path = "./scikit_learn-1.0.1-cp310-cp310-win_amd64.whl"}
scikit-learn = "*"
sklearn = "*"
pandas = "*"

gunicorn = "*"
[dev-packages]

[requires]
Expand Down
738 changes: 0 additions & 738 deletions Pipfile.lock

This file was deleted.

1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: gunicorn app:APP
43 changes: 43 additions & 0 deletions environment.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
SPOTIPY_CLIENT_ID = 'efd0c00199c5425f873b427234884f60'
SPOTIPY_CLIENT_SECRET = 'ea80e7b06ba14400ae7ffbd169a12f80'
#Create a ubuntu base image with python 3 installed.
FROM python:3.10 as base

FROM base AS python-deps

# Install python dependencies in /.venv
COPY Pipfile .
COPY Pipfile.lock .

#Install the dependencies
RUN apt-get -y update
RUN apt-get update && apt-get install -y python3 python3-pip

# Install pipenv and compilation dependencies
RUN pip3 install pipenv
RUN apt-get update && apt-get install -y --no-install-recommends gcc
RUN PIPENV_VENV_IN_PROJECT=1 pipenv install --deploy
RUN PIPENV_VENV_IN_PROJECT=1 pipenv install gunicorn

FROM base AS runtime

# Copy virtual env from python-deps stage
COPY --from=python-deps /.venv /.venv
ENV PATH="/.venv/bin:$PATH"

# Create and switch to a new user
RUN useradd --create-home appuser
WORKDIR /home/appuser
USER appuser

# Install application into container
COPY . .

# Expose the required port
EXPOSE 5000

USER root

# Run the command, if local, bind to port 5000, the exposed port
# CMD python kickstarter/models.py && gunicorn --bind 0.0.0.0:5000 kickstarter:APP
CMD python app/Spotify.py && gunicorn app:APP
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pip install pandas, os, spotipy, spotipy.oauth2, sklearn, gunicorn
Binary file removed scikit_learn-1.0.1-cp310-cp310-win_amd64.whl
Binary file not shown.