-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
68 lines (48 loc) · 1.84 KB
/
Dockerfile
File metadata and controls
68 lines (48 loc) · 1.84 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Use an official Python runtime as a parent image
FROM continuumio/miniconda3
########### PREPARE EVERYTHING FOR BUILDING #####################
# Install all dependencies
RUN apt-get update
RUN apt-get -y install build-essential
RUN apt-get install -y git python3-dev cmake make gcc g++ libssl-dev
# Set the OpenSSL root directory to the Miniconda environment
ENV OPENSSL_ROOT_DIR=/opt/conda
########################### PREPARED #############################
################# BUILDING PYMGCLIENT ############################
# Create a conda environment
RUN conda create -n bor_env python=3.9.16
# Activate the conda environment
SHELL ["conda", "run", "-n", "bor_env", "/bin/bash", "-c"]
# Clone the mgclient repository
RUN git clone --recurse-submodules https://github.com/memgraph/pymgclient.git
# Change to the repository directory
WORKDIR /pymgclient
# Change flags so warnings aren't treated as errors
ENV CFLAGS=-Wno-error
# Build the thing
RUN python setup.py install
################# BUILDING PYMGCLIENT FINISHED #####################
################# INSTALLING AND RUNNING MAGICGRAPH ################
# Set the working directory inside the container
WORKDIR /usr/src/bor
# Copy the current directory contents into the container at /usr/src/bor
COPY . /usr/src/bor
RUN pip install --upgrade pip
RUN pip install setuptools wheel
# Install the project dependencies
RUN pip install --no-cache-dir -e . -vv
# Needed for nltk to work
RUN python -m nltk.downloader punkt
# Command to run the application
ENTRYPOINT ["conda", \
"run", \
"--no-capture-output", \
"-n", \
"bor_env", \
"uvicorn", \
"core.restapi.api:app", \
"--host", \
"0.0.0.0", \
"--port", \
"8000"]
################# FINISHED ##########################################