The Dockerfile in a working folder:
FROM python:3.7
# based on: https://gist.github.com/stefanproell/89a00f3a2c18a7e9549a1de6f82cf0f8
RUN apt-get -y update && apt-get install -y \
python3-dev \
libpng-dev \
apt-utils \
python-psycopg2 \
python-dev \
postgresql-client \
&& rm -rf /var/lib/apt/lists/*
RUN pip install --upgrade setuptools
RUN pip install cython
RUN pip install numpy
RUN pip install matplotlib
RUN pip install pandas
RUN pip install pystan
RUN pip install fbprophet
RUN pip install psycopg2
RUN pip install sqlalchemy
WORKDIR /forecast
#COPY . /forecast/
#CMD [ "python", "./run_forecast.py" ]
Recommended for testing:
Copy https://raw.githubusercontent.com/facebook/prophet/master/examples/example_wp_log_peyton_manning.csv
to the working folder as example_wp_log_peyton_manning.csv
.
From the working dir:
docker build -t phrophet-py37 .
I received un error but it succeeded anyway.
The following command will run the docker image with a mounted volume to the working folder:
docker run -ti -v ${PWD}:/forecast phrophet-py37 /bin/bash
ls #should show the files from the host file system
python #start python
In the python REPL:
# Python
import pandas as pd
from fbprophet import Prophet
df = pd.read_csv('example_wp_log_peyton_manning.csv')
df.head()
m = Prophet()
m.fit(df)
future = m.make_future_dataframe(periods=365)
future.tail()