mSorok / NPlsWeb

NaPLeS - Natural Product Likeness Scorer Web Application
https://naples.naturalproducts.net
MIT License
6 stars 3 forks source link

Build error #2

Open TFMvdBroek opened 4 years ago

TFMvdBroek commented 4 years ago

Getting the following error, any idea what is going wrong? Ubuntu server 18.04

root@xxxxxdocker:/srv/www/naples.xxx.xx# docker-compose build Building nplsweb Step 1/7 : FROM openjdk:8u171-slim ---> 60575d4bfe64 Step 2/7 : EXPOSE 8090 ---> Using cache ---> 08d45f8454ca Step 3/7 : VOLUME /tmp ---> Using cache ---> 7c29c9e11e18 Step 4/7 : COPY target/nplsweb-0.0.1-SNAPSHOT.jar app.jar ERROR: Service 'nplsweb' failed to build: COPY failed: stat /var/lib/docker/tmp/docker-builder300825816/target/nplsweb-0.0.1-SNAPSHOT.jar: no such file or directory

mSorok commented 4 years ago

This looks like a copy problem, coming from the following line in the Dockerfile: COPY target/nplsweb-0.0.1-SNAPSHOT.jar app.jar

May I ask you what is the folder structure? Are you doing the "docker-compose build" from the directory with the "target" folder? Do you have the nplsweb-0.0.1-SNAPSHOT.jar in the "target" folder?

mSorok commented 4 years ago

I maybe should add to the README that the project needs to be compiled before (it was obvious to me, but I recognize this mistake from my part).

As you are running on Ubuntu, you can compile the project to create the target folder and the JAR file by running maven as following: "mvnv clean package"

Please, tell me if this worked for you!

TFMvdBroek commented 4 years ago

So i ran the build command from the resulting target folder. We get one step further then.

Step 4/7 : COPY target/nplsweb-0.0.1-SNAPSHOT.jar app.jar ---> e524df0b1e43 Step 5/7 : COPY target/inchiPet.jar / ERROR: Service 'nplsweb' failed to build: COPY failed: stat /var/lib/docker/tmp/docker-builder648788633/target/inchiPet.jar: no such file or directory

mSorok commented 4 years ago

No, you need to compile the project with Maven (to create the "target" folder) and then, still from the root folder, where you have the "target", "archive" etc folders and the Docker files, you run the "docker-compose build" and once it's built the "docker-compose up -d" command

Adoro commented 4 years ago

@mSorok the error on the missing inchiPet.jar is correct. That file is not actually in the target folder. Ive added it to the root of my project (like you did in NPdatabasefiller) and change the dockerfile accordingly. So you might want to change that for the web project too.

mSorok commented 4 years ago

Thank you for the comment! I changed the Dockerfile instead, to copy the inchiPet.jar in the root directory