Skip to content

Commit

Permalink
Add mdbtools/0.7.1 build to server Dockerfile to allow res parsing (#436
Browse files Browse the repository at this point in the history
)
  • Loading branch information
ml-evs authored Aug 18, 2023
1 parent 051735c commit 090ced9
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions .docker/server_dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,33 @@ SHELL ["/bin/bash", "--login", "-c"]
EXPOSE 5001
RUN apt update && apt install -y tree && apt clean

# Install the older version of mdbtools (0.7.1) until https://github.com/echemdata/galvani/issues/89 is resolved
WORKDIR /opt
RUN git clone https://github.com/mdbtools/mdbtools --depth 1 --branch 0.7.1
WORKDIR /opt/mdbtools
RUN autoreconf -i -f
RUN ./configure --disable-man
RUN make -j 4
RUN make install
RUN ldconfig


FROM base as app
# Copy all server code into workdir
WORKDIR /app
RUN pip install pipenv

COPY pydatalab/Pipfile pydatalab/Pipfile.lock ./

# Create development image using flask's dev server with hot-reload
FROM base as development
FROM app as development
RUN --mount=type=cache,target=/root/.cache/pip pipenv sync
ENV FLASK_APP "pydatalab.main:create_app()"
ENV FLASK_ENV "development"
CMD ["pipenv", "run", "flask", "run", "--port", "5001", "--host", "0.0.0.0"]

# Create production image using gunicorn and minimal dependencies
FROM base as production
FROM app as production
RUN --mount=type=cache,target=/root/.cache/pip pipenv sync
RUN [ "pipenv", "run", "pip", "install", "gunicorn" ]
COPY ./pydatalab/ ./
Expand Down

0 comments on commit 090ced9

Please sign in to comment.