-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (29 loc) · 1.2 KB
/
Dockerfile
File metadata and controls
41 lines (29 loc) · 1.2 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
# Use an official Python image as a base image
FROM python:3.10-slim
# Set the working directory in the container
WORKDIR /app
# Copy the local environment YAML file into the container
COPY environment.yml /app/environment.yml
# Copy your script and any other necessary files into the container
COPY BioDBTracker.py /app/BioDBTracker.py
COPY . /app
# Install system dependencies required by gspread and oauth2client
RUN apt-get update && apt-get install -y \
libssl-dev \
libffi-dev \
libsqlite3-dev \
wget \
&& rm -rf /var/lib/apt/lists/*
# Install Conda (Miniconda) for managing dependencies
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh && \
bash miniconda.sh -b -p /opt/conda && \
rm miniconda.sh && \
/opt/conda/bin/conda init
# Add Conda to PATH
ENV PATH="/opt/conda/bin:$PATH"
# Create and activate the Conda environment
RUN conda env create -f /app/environment.yml && conda clean -a
# Activate the environment in the container
SHELL ["conda", "run", "-n", "BioDBTracker", "/bin/bash", "-c"]
# Set the default command
ENTRYPOINT ["conda", "run", "--no-capture-output", "-n", "BioDBTracker", "python", "/app/BioDBTracker.py"]