diff --git a/Dockerfile b/Dockerfile index 8ff7af23..160a8f41 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,27 +1,23 @@ -FROM python:3.7 +FROM python:3.7-slim -ENV PATH=/root/.local/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin +WORKDIR /app -# install node and yarn -RUN apt-get update -RUN apt-get -y install postgresql-client +COPY Pipfile Pipfile.lock /app/ -# config project dir -RUN mkdir /crc-workflow -WORKDIR /crc-workflow +RUN pip install pipenv && \ + apt-get update && \ + apt-get install -y --no-install-recommends \ + gcc python3-dev libssl-dev postgresql-client git-core && \ + pipenv install --dev && \ + apt-get remove -y gcc python3-dev libssl-dev && \ + apt-get purge -y --auto-remove && \ + rm -rf /var/lib/apt/lists/ * -# install python requirements -RUN pip install pipenv -ADD Pipfile /crc-workflow/ -ADD Pipfile.lock /crc-workflow/ -RUN pipenv install --dev +COPY . /app/ -# include rejoiner code (gets overriden by local changes) -COPY . /crc-workflow/ - -# run webserver by default -ENV FLASK_APP=./crc/__init__.py -CMD ["pipenv", "run", "python", "./run.py"] +ENV FLASK_APP=/app/crc/__init__.py +CMD ["pipenv", "run", "flask", "db", "upgrade"] +CMD ["pipenv", "run", "python", "/app/run.py"] # expose ports EXPOSE 5000