Created
September 19, 2022 20:49
-
-
Save Lucs1590/14c1bf0b7a1ba3d545ee208530282591 to your computer and use it in GitHub Desktop.
A docker file with R, Java, Python and AWS.
This file contains hidden or 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
FROM python:3.8-slim-buster | |
COPY ./requirements.txt /app/requirements.txt | |
COPY . /app | |
WORKDIR /app | |
#JAVA CONFIG | |
RUN apt-get update | |
RUN apt-get install -y apt-utils \ | |
build-essential \ | |
gcc \ | |
wget \ | |
sudo \ | |
r-base \ | |
libnlopt-dev \ | |
curl \ | |
nano \ | |
unzip \ | |
vim \ | |
npm \ | |
libcurl4-openssl-dev \ | |
libxml2-dev | |
ENV JAVA_FOLDER java-se-8u41-ri | |
ENV JVM_ROOT /usr/lib/jvm | |
ENV JAVA_PKG_NAME openjdk-8u41-b04-linux-x64-14_jan_2020.tar.gz | |
ENV JAVA_TAR_GZ_URL https://download.java.net/openjdk/jdk8u41/ri/$JAVA_PKG_NAME | |
RUN apt-get update -y && \ | |
rm -rf /var/lib/apt/lists/* && \ | |
apt-get clean && \ | |
apt-get autoremove && \ | |
echo Downloading $JAVA_TAR_GZ_URL && \ | |
wget -q $JAVA_TAR_GZ_URL && \ | |
tar -xvf $JAVA_PKG_NAME && \ | |
rm $JAVA_PKG_NAME && \ | |
mkdir -p /usr/lib/jvm && \ | |
mv ./$JAVA_FOLDER $JVM_ROOT && \ | |
update-alternatives --install /usr/bin/java java $JVM_ROOT/$JAVA_FOLDER/bin/java 1 && \ | |
update-alternatives --install /usr/bin/javac javac $JVM_ROOT/$JAVA_FOLDER/bin/javac 1 && \ | |
java -version | |
RUN apt-get update -y && \ | |
npm install -g aws-azure-login --unsafe-perm && \ | |
pip install -r requirements.txt | |
RUN chmod +rwx /usr/local/lib/R/site-library | |
RUN R -e "install.packages('gfortran', dependencies=TRUE, repos='http://cran.rstudio.com/')" | |
CMD ["uvicorn", "--host", "0.0.0.0", "app:app"] | |
EXPOSE 8000 5000 | |
RUN sudo curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64-2.0.30.zip" -o "awscliv2.zip" | |
RUN sudo unzip awscliv2.zip | |
RUN sudo ./aws/install |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment