Skip to content

Commit bcefeb2

Browse files
committed
Add sample Dockerfile
1 parent 27e6bd2 commit bcefeb2

File tree

4 files changed

+35
-0
lines changed

4 files changed

+35
-0
lines changed

.dockerignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
**/.git/
2+
**/__pycache__/
3+
.circleci/
4+
.pytest_cache/
5+
.tox/
6+
.wheelhouse/
7+
**/CMakeCache.txt

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ __pycache__
99
/.cache
1010
/dist/
1111
/*.egg-info
12+
.pytest_cache

Dockerfile

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
FROM ubuntu:16.04
2+
3+
RUN apt-get update -qy
4+
RUN apt-get install -qy build-essential python python3 python3-pip python3-dev git cmake bison flex pkg-config
5+
RUN pip3 install cython
6+
7+
RUN mkdir /tmp/build
8+
COPY libgraphqlparser /tmp/build/libgraphqlparser
9+
COPY ast /tmp/build/ast
10+
COPY examples /tmp/build/examples
11+
COPY graphql_parser /tmp/build/graphql_parser
12+
COPY setup.py *.rst /tmp/build/
13+
14+
15+
RUN cd /tmp/build/libgraphqlparser && \
16+
cmake . && \
17+
make && \
18+
cp libgraphqlparser.so /usr/local/lib
19+
RUN cd /tmp/build && \
20+
python2 ast/build_ast.py && \
21+
LDFLAGS="-L./libgraphqlparser" CFLAGS="-Ilibgraphqlparser/c -Ilibgraphqlparser" \
22+
python3 setup.py build_ext && \
23+
pip3 install .
24+
ENV LD_LIBRARY_PATH=/usr/local/lib
25+
26+
ENTRYPOINT ["python3", "/tmp/build/examples/visitor_example.py"]

graphql_parser/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ GraphQLAstVisitor.pyx
88
.python-version
99
*.so
1010
*.html
11+
.pytest_cache

0 commit comments

Comments
 (0)