Spaces:
Runtime error
Runtime error
Commit ·
f7a767b
1
Parent(s): c0d30eb
maybe fix permission issues
Browse files- Dockerfile +14 -2
Dockerfile
CHANGED
|
@@ -1,6 +1,16 @@
|
|
| 1 |
# Use a specific version of the Python image
|
| 2 |
FROM python:3.9
|
| 3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
# Install R base and verify the installation
|
| 5 |
RUN apt-get update && \
|
| 6 |
apt-get install -y r-base && \
|
|
@@ -8,6 +18,8 @@ RUN apt-get update && \
|
|
| 8 |
R --version && \
|
| 9 |
echo R home: $(R RHOME)
|
| 10 |
|
|
|
|
|
|
|
| 11 |
RUN export RPY2_CFFI_MODE=ABI && pip install rpy2
|
| 12 |
|
| 13 |
# Set the environment variable for rpy2 installation.
|
|
@@ -24,10 +36,10 @@ RUN R -e "install.packages('reshape2', repos='https://cloud.r-project.org/')" &&
|
|
| 24 |
R -e "if (!requireNamespace('BiocManager', quietly = TRUE)) install.packages('BiocManager', repos='https://cloud.r-project.org/'); BiocManager::install(c('BSgenome', 'BSgenome.Hsapiens.UCSC.hg19', 'GenomeInfoDb', 'deconstructSigs'))"
|
| 25 |
|
| 26 |
# Set the working directory to /app
|
| 27 |
-
WORKDIR /app
|
| 28 |
|
| 29 |
# Copy your application files into the container
|
| 30 |
-
COPY . /app
|
| 31 |
|
| 32 |
# Specify the default command to run your application
|
| 33 |
CMD ["python", "app.py"]
|
|
|
|
| 1 |
# Use a specific version of the Python image
|
| 2 |
FROM python:3.9
|
| 3 |
|
| 4 |
+
# Set up a new user named "user" with user ID 1000
|
| 5 |
+
RUN useradd -m -u 1000 user
|
| 6 |
+
|
| 7 |
+
# Switch to the "user" user
|
| 8 |
+
USER user
|
| 9 |
+
|
| 10 |
+
# Set home to the user's home directory
|
| 11 |
+
ENV HOME=/home/user \
|
| 12 |
+
PATH=/home/user/.local/bin:$PATH
|
| 13 |
+
|
| 14 |
# Install R base and verify the installation
|
| 15 |
RUN apt-get update && \
|
| 16 |
apt-get install -y r-base && \
|
|
|
|
| 18 |
R --version && \
|
| 19 |
echo R home: $(R RHOME)
|
| 20 |
|
| 21 |
+
WORKDIR $HOME/app
|
| 22 |
+
|
| 23 |
RUN export RPY2_CFFI_MODE=ABI && pip install rpy2
|
| 24 |
|
| 25 |
# Set the environment variable for rpy2 installation.
|
|
|
|
| 36 |
R -e "if (!requireNamespace('BiocManager', quietly = TRUE)) install.packages('BiocManager', repos='https://cloud.r-project.org/'); BiocManager::install(c('BSgenome', 'BSgenome.Hsapiens.UCSC.hg19', 'GenomeInfoDb', 'deconstructSigs'))"
|
| 37 |
|
| 38 |
# Set the working directory to /app
|
| 39 |
+
WORKDIR $HOME/app
|
| 40 |
|
| 41 |
# Copy your application files into the container
|
| 42 |
+
COPY . $HOME/app
|
| 43 |
|
| 44 |
# Specify the default command to run your application
|
| 45 |
CMD ["python", "app.py"]
|