Skip to content

Instantly share code, notes, and snippets.

@vilmibm
Created July 16, 2016 04:36
Show Gist options
  • Save vilmibm/177e5084c857891b1a4a47c97a6d6247 to your computer and use it in GitHub Desktop.
Save vilmibm/177e5084c857891b1a4a47c97a6d6247 to your computer and use it in GitHub Desktop.
this just doesn't work at all
FROM debian:testing
MAINTAINER nathanielksmith <[email protected]>
EXPOSE 8000
RUN apt-get update
RUN apt-get -y install python3 python3-setuptools postgresql
RUN apt-get -y install ca-certificates build-essential
RUN apt-get -y install libffi-dev postgresql-server-dev-9.5 python3-dev
RUN service postgresql start
#RUN service postgresql status
RUN sleep 11
RUN service postgresql status
RUN su postgres -c "psql -c \"create user prosaic with password 'prosaic'\""
RUN su postgres -c "createdb prosaic -O prosaic"
RUN python3 -mpip install numpy==1.9.0
ADD . /prosaicweb
WORKDIR /prosaicweb
# must be in python project dir, otherwise setuptools walks entire filesystem
RUN python3 setup.py install
RUN prosaicweb dbinit
CMD gunicorn prosaicweb:app
@datagrok
Copy link

So, this seems to work, up until "prosaicweb dbinit", which dies with a traceback:

Traceback (most recent call last):
  File "/usr/local/bin/prosaicweb", line 9, in <module>
    load_entry_point('prosaicweb==1.0.0', 'console_scripts', 'prosaicweb')()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 542, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2569, in load_entry_point
    return ep.load()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2229, in load
    return self.resolve()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2235, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/local/lib/python3.5/dist-packages/prosaicweb-1.0.0-py3.5.egg/prosaicweb/__init__.py", line 18, in <module>
    from . import views
ImportError: cannot import name 'views'
#Dockerfile
FROM debian:testing
MAINTAINER nathanielksmith <[email protected]>
EXPOSE 8000
RUN apt-get update
RUN apt-get -y install \
    build-essential \
    ca-certificates \
    libffi-dev \
    postgresql \
    postgresql-server-dev-9.5 \
    python3 \
    python3-dev \
    python3-pip \
    python3-setuptools
RUN pip3 install numpy==1.9.0
ADD prosaicweb /prosaicweb
WORKDIR /prosaicweb
# must be in python project dir, otherwise setuptools walks entire filesystem
RUN python3 setup.py install
RUN service postgresql start; \
    service postgresql status; \
    su postgres -c "psql -c \"create user prosaic with password 'prosaic'\""; \
    su postgres -c "createdb prosaic -O prosaic";
RUN service postgresql start; \
    service postgresql status; \
    prosaicweb dbinit
CMD service postgresql start; gunicorn prosaicweb:app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment