forked from mage-ai/mage-ai
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
48 lines (39 loc) · 1.95 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
FROM python:3.10
LABEL description="Deploy Mage on ECS"
ARG PIP=pip3
USER root
# Download ODBC headers for pyodbc
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
RUN curl https://packages.microsoft.com/config/debian/11/prod.list > /etc/apt/sources.list.d/mssql-release.list
RUN apt -y update
RUN ACCEPT_EULA=Y apt -y install msodbcsql18
RUN apt -y install unixodbc-dev
# Install NFS dependencies, and pymssql dependencies
RUN apt -y install nfs-common freetds-dev freetds-bin
# Install Mage
RUN ${PIP} install --upgrade pip
RUN ${PIP} install --no-cache "git+https://github.com/mage-ai/mage-ai.git#egg=mage-integrations&subdirectory=mage_integrations"
RUN ${PIP} install "git+https://github.com/mage-ai/dbt-mysql.git#egg=dbt-mysql"
RUN ${PIP} install "git+https://github.com/mage-ai/singer-python.git#egg=singer-python"
RUN ${PIP} install "git+https://github.com/mage-ai/google-ads-python.git#egg=google-ads"
COPY ./mage_ai/server/constants.py constants.py
RUN tag=$(tail -n 1 constants.py) && VERSION=$(echo $tag | tr -d "'") && ${PIP} install --no-cache "mage-ai[all]"==$VERSION
# Install R
RUN apt install -y r-base
RUN R -e "install.packages('pacman', repos='http://cran.us.r-project.org')"
# Set up spark kernel
RUN ${PIP} install sparkmagic
RUN mkdir ~/.sparkmagic
RUN wget https://raw.githubusercontent.com/jupyter-incubator/sparkmagic/master/sparkmagic/example_config.json
RUN mv example_config.json ~/.sparkmagic/config.json
RUN sed -i 's/localhost:8998/host.docker.internal:9999/g' ~/.sparkmagic/config.json
RUN jupyter-kernelspec install --user $(pip show sparkmagic | grep Location | cut -d" " -f2)/sparkmagic/kernels/pysparkkernel
EXPOSE 6789
EXPOSE 7789
ENV MAGE_DATA_DIR="/home/src/mage_data"
ENV PYTHONPATH="${PYTHONPATH}:/home/src"
WORKDIR /home/src
COPY ./scripts/install_other_dependencies.py /app/install_other_dependencies.py
COPY ./scripts/run_app.sh /app/run_app.sh
RUN chmod +x /app/run_app.sh
CMD ["/bin/sh", "-c", "/app/run_app.sh"]