-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdockerfile
More file actions
63 lines (49 loc) · 1.8 KB
/
dockerfile
File metadata and controls
63 lines (49 loc) · 1.8 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
# Base image for a development container
FROM python:3.10-slim
# Install system dependencies
RUN apt-get update && apt-get install -y \
curl \
git \
wget \
gdebi-core \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# Install rig
RUN curl -Ls https://github.com/r-lib/rig/releases/download/latest/rig-linux-$(arch)-latest.tar.gz | `which sudo` tar xz -C /usr/local
# Add rig to PATH
ENV PATH="/usr/local/bin:$PATH"
# Install R using rig
RUN rig add release
# Set architecture-specific Quarto URL
# This runs at build time to determine the architecture and download the correct Quarto package.
RUN ARCH=$(uname -m) && \
if [ "$(uname -m)" = "x86_64" ]; then \
ARCH="amd64"; \
elif [ "$(uname -m)" = "arm64" ] || [ "$(uname -m)" = "aarch64" ]; then \
ARCH="arm64"; \
else \
echo "Unsupported architecture"; exit 1; \
fi && \
curl -fsSL https://github.com/quarto-dev/quarto-cli/releases/download/v1.6.42/quarto-1.6.42-linux-${ARCH}.tar.gz | tar -xz -C /opt \
&& ln -s /opt/quarto-1.6.42/bin/quarto /usr/local/bin/quarto
# Verify Quarto installation
RUN quarto --version
# Define an argument for the working directory
ARG WORKDIR=/workspaces/hds
# Set up the working environment
WORKDIR $WORKDIR
# Copy the entire repository
COPY . .
# Remove any existing virtual environment and create a new one, then install Python dependencies
RUN rm -rf venv \
&& python -m venv venv \
&& . venv/bin/activate \
&& pip install --no-cache-dir -r requirements.txt
# Set environment variables for venv
ENV VIRTUAL_ENV=$WORKDIR/venv
ENV PATH="$WORKDIR/venv/bin:$PATH"
# Add venv activation to .bashrc for interactive shells
RUN echo ". $WORKDIR/venv/bin/activate" >> /root/.bashrc
# Set default shell
SHELL ["/bin/bash", "-c"]
# Default entrypoint
CMD ["bash", "--login"]