-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (25 loc) · 986 Bytes
/
Dockerfile
File metadata and controls
31 lines (25 loc) · 986 Bytes
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
ARG BASE_IMAGE="ubuntu:latest"
FROM ${BASE_IMAGE} AS builder
USER root
WORKDIR /build
ENV FC=gfortran
ARG FVS_VERSION
RUN apt-get update \
&& apt-get install -y git build-essential gfortran cmake unixodbc-dev
RUN git clone -b "${FVS_VERSION}" --recurse-submodules https://github.com/USDAForestService/ForestVegetationSimulator.git
RUN cd /build/ForestVegetationSimulator/bin \
&& make US
FROM python:3.11-slim AS runtime
COPY --from=builder /build/ForestVegetationSimulator/bin/FVS??.so /usr/local/lib
COPY --from=builder /build/ForestVegetationSimulator/bin/FVS?? /usr/local/bin
ARG APP_DIR=/workspaces/fvs2py
ENV APP_DIR=${APP_DIR}
WORKDIR ${APP_DIR}
COPY ./requirements.txt .
ENV PIP_PREFER_BINARY=1
RUN pip install --upgrade pip pip-tools \
&& pip install --no-cache-dir --upgrade -r requirements.txt \
&& rm requirements.txt
COPY ./pyproject.toml ./README.md ./LICENSE ${APP_DIR}/
COPY ./fvs2py ${APP_DIR}/fvs2py
RUN pip install --no-deps --no-cache-dir -e .