-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (20 loc) · 1.17 KB
/
Dockerfile
File metadata and controls
28 lines (20 loc) · 1.17 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
FROM mageai/mageai:latest
# Replace default_repo with the name of your project (e.g. demo_project)
ARG PROJECT_NAME=default_repo
ARG MAGE_CODE_PATH=/home/mage_data
ARG USER_CODE_PATH=${MAGE_CODE_PATH}/${PROJECT_NAME}
# Set the MAGE_CODE_PATH variable to the path of the Mage code.
ENV PYTHONPATH="${PYTHONPATH}:${MAGE_CODE_PATH}"
WORKDIR ${MAGE_CODE_PATH}
# Replace [project_name] with the name of your project (e.g. demo_project)
COPY ${PROJECT_NAME} ${PROJECT_NAME}
# Set the USER_CODE_PATH variable to the path of user project.
# The project path needs to contain project name.
# Replace [project_name] with the name of your project (e.g. demo_project)
ENV USER_CODE_PATH=${USER_CODE_PATH}
# Install custom Python libraries if requirements.txt exists
RUN if [ -f ${USER_CODE_PATH}/requirements.txt ]; then pip3 install -r ${USER_CODE_PATH}/requirements.txt; fi
# Install custom libraries within 3rd party libraries (e.g. DBT packages) if install_other_dependencies.py exists
RUN if [ -f /app/install_other_dependencies.py ]; then python3 /app/install_other_dependencies.py --path ${USER_CODE_PATH}; fi
ENV PYTHONPATH="${PYTHONPATH}:${MAGE_CODE_PATH}"
CMD ["/bin/sh", "-c", "/app/run_app.sh"]