Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +10 -11
Dockerfile
CHANGED
@@ -1,21 +1,20 @@
|
|
|
|
1 |
FROM continuumio/miniconda3:4.12.0
|
2 |
|
3 |
-
# Set
|
|
|
|
|
|
|
4 |
WORKDIR /code
|
5 |
COPY ./environment.yml /code/environment.yml
|
6 |
|
7 |
-
#
|
8 |
-
RUN conda
|
9 |
-
conda create -
|
10 |
-
conda clean --all --yes
|
11 |
-
|
12 |
-
# Activate the environment and install dependencies
|
13 |
-
RUN echo "conda activate myenv" >> ~/.bashrc && \
|
14 |
-
conda run -n myenv conda env update -f /code/environment.yml && \
|
15 |
conda clean --all --yes
|
16 |
|
17 |
-
#
|
18 |
-
ENV PATH
|
19 |
|
20 |
# Set up a new user named "user" with user ID 1000
|
21 |
RUN useradd -m -u 1000 user
|
|
|
1 |
+
# Start from the Miniconda3 base image
|
2 |
FROM continuumio/miniconda3:4.12.0
|
3 |
|
4 |
+
# Set the Python version you want
|
5 |
+
ENV PYTHON_VERSION=3.10.15
|
6 |
+
|
7 |
+
# Set up the working directory
|
8 |
WORKDIR /code
|
9 |
COPY ./environment.yml /code/environment.yml
|
10 |
|
11 |
+
# Create the environment using the environment.yml file
|
12 |
+
RUN conda install python=$PYTHON_VERSION -y && \
|
13 |
+
conda env create -f /code/environment.yml && \
|
|
|
|
|
|
|
|
|
|
|
14 |
conda clean --all --yes
|
15 |
|
16 |
+
# Activate the environment
|
17 |
+
ENV PATH="/opt/conda/envs/$(head -n 1 /code/environment.yml | cut -d ' ' -f 2)/bin:$PATH"
|
18 |
|
19 |
# Set up a new user named "user" with user ID 1000
|
20 |
RUN useradd -m -u 1000 user
|