elgris / microservice-app-example

Example of polyglot microservice app
MIT License
1.39k stars 333 forks source link

Fixing dependencies #3

Closed orasik closed 6 years ago

orasik commented 6 years ago
tradziej commented 6 years ago

👍 @orasik it would be nice to have similar refactor on todos-api and users-api Dockerfiles.

orasik commented 6 years ago

@tradziej java and maven are done in users-api and todos-api already has npm install. Did you get any specific error when running docker-compose?

tradziej commented 6 years ago

@orasik microserviceappexample_auth-api_1 exited with code 126 microserviceappexample_users-api_1 exited with code 1

orasik commented 6 years ago

@tradziej I see, this requires more work. I will fix it and keep you updated

mystygage commented 6 years ago

@orasik when running docker-compose up with this PR, I get this error:

Step 6/10 : RUN wget http://archive.apache.org/dist/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz &&   tar -zxvf apache-maven-$MAVEN_VERSION-bin.tar.gz &&   rm apache-maven-$MAVEN_VERSION-bin.tar.gz &&   mv apache-maven-$MAVEN_VERSION /usr/lib/mvn
 ---> Running in e1965ea8d8f0
Connecting to archive.apache.org (163.172.17.199:80)
wget: error getting response: Invalid argument
ERROR: Service 'users-api' failed to build: The command '/bin/sh -c wget http://archive.apache.org/dist/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz &&   tar -zxvf apache-maven-$MAVEN_VERSION-bin.tar.gz &&   rm apache-maven-$MAVEN_VERSION-bin.tar.gz &&   mv apache-maven-$MAVEN_VERSION /usr/lib/mvn' returned a non-zero code: 1
orasik commented 6 years ago

User-api is fixed now and running just fine after moving the installation bit to run.sh file I have updated the PR to install golang and glide but I'm afraid there was another issue which I believe is related to the code:

[INFO]  Downloading dependencies. Please wait...
[INFO]  --> Fetching golang.org/x/crypto
[INFO]  --> Fetching github.com/labstack/echo
[INFO]  --> Detected semantic version. Setting version for github.com/labstack/echo to 3.2.4
[INFO]  Resolving imports
[INFO]  --> Fetching github.com/dgrijalva/jwt-go
[INFO]  --> Fetching github.com/labstack/gommon
[INFO]  --> Fetching github.com/valyala/fasttemplate
[INFO]  --> Fetching github.com/mattn/go-colorable
[INFO]  --> Fetching github.com/mattn/go-isatty
[INFO]  --> Fetching github.com/valyala/bytebufferpool
[INFO]  --> Fetching golang.org/x/sys
[INFO]  Downloading dependencies. Please wait...
[INFO]  Setting references for remaining imports
[INFO]  Exporting resolved dependencies...
[INFO]  --> Exporting github.com/labstack/echo
[INFO]  --> Exporting github.com/dgrijalva/jwt-go
[INFO]  --> Exporting github.com/mattn/go-colorable
[INFO]  --> Exporting github.com/labstack/gommon
[INFO]  --> Exporting github.com/valyala/fasttemplate
[INFO]  --> Exporting github.com/mattn/go-isatty
[INFO]  --> Exporting github.com/valyala/bytebufferpool
[INFO]  --> Exporting golang.org/x/crypto
[INFO]  --> Exporting golang.org/x/sys
[INFO]  Replacing existing vendor dependencies
[INFO]  Project relies on 9 dependencies.
main.go:10:2: cannot find package "github.com/dgrijalva/jwt-go" in any of:
    /usr/lib/go-1.6/src/github.com/dgrijalva/jwt-go (from $GOROOT)
    /usr/src/github.com/dgrijalva/jwt-go (from $GOPATH)
main.go:11:2: cannot find package "github.com/labstack/echo" in any of:
    /usr/lib/go-1.6/src/github.com/labstack/echo (from $GOROOT)
    /usr/src/github.com/labstack/echo (from $GOPATH)
main.go:12:2: cannot find package "github.com/labstack/echo/middleware" in any of:
    /usr/lib/go-1.6/src/github.com/labstack/echo/middleware (from $GOROOT)
    /usr/src/github.com/labstack/echo/middleware (from $GOPATH)
elgris commented 6 years ago

@orasik thanks! No worries, that's just misconfiguration of GOPATH variable in Dockerfile of auth-api. Going to fix that shortly