generated from NOAA-OWP/owp-open-source-project-template
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
117 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
FROM rockylinux:9.2 as rocky-base | ||
|
||
RUN yum install -y epel-release | ||
RUN yum install -y netcdf netcdf-fortran netcdf-fortran-devel netcdf-openmpi | ||
|
||
RUN yum install -y git cmake python python-devel pip | ||
|
||
WORKDIR "/t-route/" | ||
|
||
# Copy the contents of the parent directory (repository root) into the container | ||
COPY . /t-route/ | ||
|
||
RUN ln -s /usr/lib64/gfortran/modules/netcdf.mod /usr/include/openmpi-x86_64/netcdf.mod | ||
|
||
ENV PYTHONPATH=/t-route:$PYTHONPATH | ||
RUN pip install uv==0.2.5 | ||
RUN uv venv | ||
|
||
ENV VIRTUAL_ENV=/t-route/.venv | ||
ENV PATH="$VIRTUAL_ENV/bin:$PATH" | ||
|
||
RUN uv pip install --no-cache-dir -r /t-route/requirements.txt | ||
|
||
RUN ./compiler.sh no-e | ||
|
||
RUN uv pip install --no-cache-dir -r /t-route/requirements-app.txt | ||
|
||
WORKDIR "/t-route/src/" | ||
RUN mkdir -p /t-route/data/troute_restart/ | ||
|
||
# Create volume mount points | ||
RUN mkdir -p ${OUTPUT_VOLUME_TARGET} ${DATA_VOLUME_TARGET} ${CORE_VOLUME_TARGET} /t-route/test | ||
|
||
# Set the command to run the application | ||
CMD sh -c ". /t-route/.venv/bin/activate && uvicorn app.main:app --host 0.0.0.0 --port ${PORT}" | ||
|
||
# Add healthcheck | ||
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \ | ||
CMD curl --fail -I http://localhost:${PORT}/health || exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Port mapping | ||
#------------- | ||
# The following port will be used for spinning up the API server | ||
|
||
PORT=8000 | ||
|
||
# Volume bindings | ||
# --------------- | ||
# The following variables are used in the compose.yaml file to define the shared volume mount with T-Route | ||
|
||
# For saving output from the container | ||
OUTPUT_VOLUME_SOURCE=../test/api/data/troute_output | ||
OUTPUT_VOLUME_TARGET=/t-route/output | ||
|
||
# For mounting the data directory | ||
DATA_VOLUME_SOURCE=../test/api/data | ||
DATA_VOLUME_TARGET=/t-route/data | ||
|
||
# For mounting all core files within T-Route (Used for sharing template config files) | ||
CORE_VOLUME_SOURCE=../src/app/core | ||
CORE_VOLUME_TARGET=/t-route/src/app/core | ||
|
||
# For uploading test data scripts | ||
TEST_SOURCE=../test | ||
TEST_TARGET=/t-route/test |
This file was deleted.
Oops, something went wrong.