forked from hotosm/fAIr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated requirements alongside with dockerfile comments and migration…
…s bash script
- Loading branch information
1 parent
95b3b5b
commit 08f3402
Showing
7 changed files
with
79 additions
and
50 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,38 @@ | ||
# Use a specific base image with GPU support | ||
FROM tensorflow/tensorflow:2.9.2-gpu | ||
|
||
RUN apt-get update && apt-get install -y python3-opencv | ||
RUN add-apt-repository ppa:ubuntugis/ppa && apt-get update | ||
RUN apt-get update | ||
RUN apt-get install -y gdal-bin | ||
RUN apt-get install -y libgdal-dev | ||
# Update package lists and install necessary dependencies in a single step | ||
RUN apt-get update && \ | ||
apt-get install -y python3-opencv gdal-bin libgdal-dev && \ | ||
add-apt-repository ppa:ubuntugis/ppa && \ | ||
apt-get update && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Set environment variables for GDAL | ||
ENV CPLUS_INCLUDE_PATH=/usr/include/gdal | ||
ENV C_INCLUDE_PATH=/usr/include/gdal | ||
|
||
#install numpy before gdal | ||
# Install specific version of NumPy | ||
RUN pip install numpy==1.23.5 | ||
|
||
# pip install dependencies. | ||
RUN pip install --global-option=build_ext --global-option="-I/usr/include/gdal" GDAL==`gdal-config --version` | ||
|
||
COPY docker/ramp/docker-requirements.txt docker-requirements.txt | ||
RUN pip install -r docker-requirements.txt | ||
# Install GDAL with specified options | ||
RUN pip install --global-option=build_ext --global-option="-I/usr/include/gdal" GDAL==$(gdal-config --version) | ||
|
||
# pip install solaris -- try with tmp-free build | ||
COPY docker/ramp/solaris /tmp/solaris | ||
RUN pip install /tmp/solaris --use-feature=in-tree-build | ||
# Copy and install Python requirements | ||
COPY docker/ramp/docker-requirements.txt /tmp/docker-requirements.txt | ||
RUN pip install -r /tmp/docker-requirements.txt | ||
|
||
RUN pip install scikit-fmm --use-feature=in-tree-build | ||
# Upgrade setuptools | ||
RUN pip install --upgrade setuptools | ||
|
||
RUN pip install setuptools --upgrade | ||
COPY requirements.txt /tmp/requirements.txt | ||
RUN pip install -r /tmp/requirements.txt | ||
|
||
COPY requirements.txt requirements.txt | ||
RUN pip install -r requirements.txt | ||
# Install solaris and scikit-fmm packages | ||
COPY docker/ramp/solaris /tmp/solaris | ||
RUN pip install /tmp/solaris --use-feature=in-tree-build && \ | ||
pip install scikit-fmm --use-feature=in-tree-build | ||
|
||
# Set working directory and copy the application code | ||
WORKDIR /app | ||
COPY . /app | ||
COPY . /app |
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 |
---|---|---|
@@ -1,32 +1,39 @@ | ||
# Use a specific base image with the desired TensorFlow version | ||
FROM tensorflow/tensorflow:2.9.2 | ||
|
||
RUN apt-get update && apt-get install -y python3-opencv | ||
RUN add-apt-repository ppa:ubuntugis/ppa && apt-get update | ||
RUN apt-get update | ||
RUN apt-get install -y gdal-bin | ||
RUN apt-get install -y libgdal-dev | ||
# Update package lists and install necessary dependencies in a single step | ||
RUN apt-get update && \ | ||
apt-get install -y software-properties-common python3-opencv && \ | ||
add-apt-repository ppa:ubuntugis/ppa && \ | ||
apt-get update && \ | ||
apt-get install -y gdal-bin libgdal-dev && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Set environment variables for GDAL | ||
ENV CPLUS_INCLUDE_PATH=/usr/include/gdal | ||
ENV C_INCLUDE_PATH=/usr/include/gdal | ||
|
||
#install numpy before gdal | ||
# Install specific version of NumPy | ||
RUN pip install numpy==1.23.5 | ||
|
||
# pip install dependencies. | ||
RUN pip install --global-option=build_ext --global-option="-I/usr/include/gdal" GDAL==`gdal-config --version` | ||
|
||
COPY docker/ramp/docker-requirements.txt docker-requirements.txt | ||
RUN pip install -r docker-requirements.txt | ||
# Install GDAL with specified options | ||
RUN pip install --global-option=build_ext --global-option="-I/usr/include/gdal" GDAL==$(gdal-config --version) | ||
|
||
# pip install solaris -- try with tmp-free build | ||
COPY docker/ramp/solaris /tmp/solaris | ||
RUN pip install /tmp/solaris --use-feature=in-tree-build | ||
# Copy and install Python requirements | ||
COPY docker/ramp/docker-requirements.txt /tmp/docker-requirements.txt | ||
RUN pip install -r /tmp/docker-requirements.txt | ||
|
||
RUN pip install scikit-fmm --use-feature=in-tree-build | ||
# Upgrade setuptools | ||
RUN pip install --upgrade setuptools | ||
|
||
RUN pip install setuptools --upgrade | ||
COPY requirements.txt /tmp/requirements.txt | ||
RUN pip install -r /tmp/requirements.txt | ||
|
||
COPY requirements.txt requirements.txt | ||
RUN pip install -r requirements.txt | ||
# Install solaris and scikit-fmm packages | ||
COPY docker/ramp/solaris /tmp/solaris | ||
RUN pip install /tmp/solaris --use-feature=in-tree-build && \ | ||
pip install scikit-fmm --use-feature=in-tree-build | ||
|
||
# Set working directory and copy the application code | ||
WORKDIR /app | ||
COPY . /app | ||
COPY . /app |
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
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,6 @@ | ||
#!/bin/bash | ||
|
||
docker exec -it api bash -c "python manage.py makemigrations" | ||
docker exec -it api bash -c "python manage.py makemigrations login" | ||
docker exec -it api bash -c "python manage.py makemigrations core" | ||
docker exec -it api bash -c "python manage.py migrate" |