-
-
Notifications
You must be signed in to change notification settings - Fork 30
/
Dockerfile
51 lines (41 loc) · 1.74 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# syntax = docker/dockerfile:experimental
FROM pytorch/pytorch:1.11.0-cuda11.3-cudnn8-runtime
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
RUN pip3 install --no-cache-dir --upgrade pip
RUN CFLAGS="-g0 -Os -DNDEBUG -Wl,--strip-all -I/usr/include:/usr/local/include -L/usr/lib:/usr/local/lib" \
DEEPPARSE_RELEASE_BUILD=1 \
pip3 install --no-cache-dir \
--compile \
--global-option=build_ext \
--global-option="-j 4" \
--no-deps -U git+https://github.com/GRAAL-Research/deepparse.git@stable
RUN find /opt/conda/lib/ -follow -type f -name '*.a' -delete \
&& find /opt/conda/lib/ -follow -type f -name '*.pyc' -delete \
&& find /opt/conda/lib/ -follow -type f -name '*.txt' -delete \
&& find /opt/conda/lib/ -follow -type f -name '*.mc' -delete \
&& find /opt/conda/lib/ -follow -type f -name '*.js.map' -delete \
&& find /opt/conda/lib/ -name '*.c' -delete \
&& find /opt/conda/lib/ -name '*.pxd' -delete \
&& find /opt/conda/lib/ -follow -type f -name '*.md' -delete \
&& find /opt/conda/lib/ -follow -type f -name '*.png' -delete \
&& find /opt/conda/lib/ -follow -type f -name '*.jpg' -delete \
&& find /opt/conda/lib/ -follow -type f -name '*.jpeg' -delete \
&& find /opt/conda/lib/ -name '*.pyd' -delete \
&& find /opt/conda/lib/ -name '__pycache__' | xargs rm -r
ENV PATH /opt/conda/bin:$PATH
FROM python:3.11.0-slim AS app
# set work directory
# set env variables
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV ENVIRONMENT=local
# copy project
COPY /deepparse ./deepparse
COPY setup.cfg ./
COPY setup.py ./
COPY README.md ./
COPY version.txt ./
RUN pip install -e .[app]