|
1 | | -# DOCKERFILE for Coding for Economists |
2 | | -# Please note that you will need a lot of RAM dedicated to Docker to build this image (15Gb+, change this in your docker settings) |
| 1 | +# DOCKERFILE for Python for Data Science |
3 | 2 |
|
4 | | -# Set base image (this also loads the Alpine Linux operating system) |
5 | | -FROM continuumio/miniconda3:4.10.3-alpine |
| 3 | +# Set base image |
| 4 | +FROM python:3.10-slim-bookworm |
6 | 5 |
|
7 | 6 | WORKDIR /app |
8 | 7 |
|
9 | 8 | # Update Linux package list and install some key libraries, including latex |
10 | | -RUN apk update && apk add openssl graphviz \ |
11 | | - nano texlive alpine-sdk build-base graphviz-dev \ |
12 | | - bash |
| 9 | +RUN apt-get -y update && apt-get install -y openssl graphviz \ |
| 10 | + nano texlive graphviz-dev \ |
| 11 | + bash build-essential git |
13 | 12 |
|
14 | 13 | # change default shell from ash to bash |
15 | 14 | RUN sed -i -e "s/bin\/ash/bin\/bash/" /etc/passwd |
16 | 15 |
|
17 | | -# Install mamba |
18 | | -RUN conda install mamba -n base -c conda-forge |
| 16 | +# Create the environment: |
| 17 | +COPY uv.lock . |
| 18 | +COPY pyproject.toml . |
19 | 19 |
|
20 | | -# Ensure pip's setuptools is latest |
21 | | -RUN pip install --upgrade setuptools wheel |
| 20 | +# Install uv |
| 21 | +COPY --from=ghcr.io/astral-sh/uv:0.5.14 /uv /bin/uv |
22 | 22 |
|
23 | | -# Create the environment: |
24 | | -COPY environment.yml . |
25 | 23 | # Install everything at once: |
26 | | -RUN mamba env create -f environment.yml |
27 | | -# Do a debug or incremental env install (builds quickly): |
28 | | -# RUN mamba create -n python4DS -c conda-forge python=3.9 numpy pandas -y |
29 | | - |
30 | | -# Make RUN commands use the new environment: |
31 | | -SHELL ["conda", "run", "-n", "py4ds2e", "/bin/bash", "-c"] |
| 24 | +RUN uv sync --frozen |
32 | 25 |
|
33 | | -RUN mamba list |
| 26 | +RUN uv pip list |
34 | 27 |
|
35 | 28 | # Copy the current directory contents into the container at /app |
36 | 29 | COPY . /app |
37 | 30 |
|
38 | | -RUN echo "Success building the python4DS container!" |
| 31 | +RUN echo "Success building the Python4DS container!" |
0 commit comments