Skip to content

Instantly share code, notes, and snippets.

@johndpope
Last active October 10, 2016 00:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johndpope/5772af264aa1495ed2a5a192019513e1 to your computer and use it in GitHub Desktop.
Save johndpope/5772af264aa1495ed2a5a192019513e1 to your computer and use it in GitHub Desktop.
Parsey McParseface + API + django + dockerfile https://github.com/dan-nadler/ParseyAPI.git
FROM brianlow/syntaxnet
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
curl \
git \
libfreetype6-dev \
libpng12-dev \
libzmq3-dev \
pkg-config \
python3 \
python3-pip \
rsync \
software-properties-common \
swig \
unzip \
zip \
zlib1g-dev \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN pip install virtualenv
RUN cd /
RUN git clone https://github.com/dan-nadler/ParseyAPI.git /ParseyAPI
RUN cd /ParseyAPI
#django import error woes
RUN python3 -m pip install django
RUN virtualenv -p /usr/bin/python3 ./
RUN /bin/bash -c 'source ./bin/activate'
RUN python3 /ParseyAPI/manage.py migrate
EXPOSE 8000
RUN python3 /ParseyAPI/manage.py runserver 0.0.0.0:8000
VOLUME ["/src"]
WORKDIR /src
# COMMANDS to build and run
# ===============================
# mkdir build && cp Dockerfile build/ && cd build
# docker build -t ParseyAPI .
# docker run ParseyAPI
# docker run -it ParseyAPI /bin/bash
# http://0.0.0.0:8000/parse/getParse?text=to%20be%20or%20not%20to%20be%20that%20is%20the%20question
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment