-
Notifications
You must be signed in to change notification settings - Fork 9
/
Dockerfile
52 lines (39 loc) · 1.19 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
52
# SPDX-License-Identifier: Apache-2.0
FROM continuumio/miniconda3:24.5.0-0
# Update OS and install packages
RUN <<EOF
apt-get update --yes
apt-get dist-upgrade --yes
apt-get install --yes \
build-essential \
curl \
unzip \
vim \
zip
EOF
# Create an application user
RUN useradd app_user --create-home
ARG APP_DIR="/opt/spark_substrait_gateway"
RUN mkdir --parents ${APP_DIR} && \
chown app_user:app_user ${APP_DIR}
USER app_user
WORKDIR ${APP_DIR}
COPY --chown=app_user:app_user . .
# Install Rust/Cargo - see: https://doc.rust-lang.org/cargo/getting-started/installation.html
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
# Setup a Python Virtual environment
RUN <<EOF
set -eux
# Setup the Python Conda environment
. ${HOME}/.cargo/env
conda init bash
. ~/.bashrc
conda env create -f environment.yml
EOF
# Make RUN commands use the new environment:
SHELL ["conda", "run", "-n", "spark-substrait-gateway-env", "/bin/bash", "-c"]
RUN pip install .
# Expose the gRPC port
EXPOSE 50051
ENV GENERATE_CLIENT_DEMO_DATA="true"
ENTRYPOINT ["conda", "run", "--no-capture-output", "-n", "spark-substrait-gateway-env", "scripts/start_demo_server.sh"]