Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
aryanbhosale authored Nov 12, 2024
1 parent 0de6465 commit 6f7db85
Showing 1 changed file with 6 additions and 22 deletions.
28 changes: 6 additions & 22 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,33 +1,17 @@
# Use Miniconda3 as the base image
FROM continuumio/miniconda3:latest
# Use an official Python runtime as a parent image
FROM python:3.11-slim

# Set the working directory in the container
WORKDIR /app

# Install system dependencies
RUN apt-get update && \
apt-get install -y git unzip g++ gcc libgeos++-dev libproj-dev proj-data proj-bin && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Copy the pyproject.toml file and the entire project directory
COPY pyproject.toml .
# Copy the project files to the container
COPY . /app

# Create a new conda environment
RUN conda create -n myenv python=3.12 -y

# Activate the conda environment
SHELL ["conda", "run", "-n", "myenv", "/bin/bash", "-c"]

# Install conda packages
RUN conda install -c conda-forge xesmf esmpy h5py numcodecs -y

# Install the project and its dependencies
RUN pip install --no-cache-dir -e .
RUN pip install .

# Expose port 8000 to the outside world
EXPOSE 8000

# Set the default command to run when the container starts
CMD ["conda", "run", "--no-capture-output", "-n", "myenv", "python", "api/main.py"]
# Run the application using python main.py
CMD ["python", "api/main.py"]

0 comments on commit 6f7db85

Please sign in to comment.