microservices-demo/src/adservice
Colin Nelson 571285d9aa Optimized adservice Image Size (#67)
* adservice: Reduced docker image size to ~165MB
(down from ~886MB) by switching to alpine and
using multi stage builds

* adservice: Changed install of glibc in builder to not require untrusted packages

* adservice: Refactored Dockerfile to be a multi stage build. The 'build' step runs from openjdk:8-slim, but the final image is alpine based. We can get away from this since java runs in a vm & the architecture of the images doesn't change between biuld steps
2018-10-09 10:42:49 -07:00
..
gradle/wrapper Initial commit for Ads Service. (#21) 2018-08-22 17:02:46 -07:00
src/main adservice: enable structured logging and OpenCensus log correlation (#59) 2018-10-01 22:45:09 -07:00
.gitignore Initial commit for Ads Service. (#21) 2018-08-22 17:02:46 -07:00
build.gradle adservice: enable structured logging and OpenCensus log correlation (#59) 2018-10-01 22:45:09 -07:00
Dockerfile Optimized adservice Image Size (#67) 2018-10-09 10:42:49 -07:00
genproto.sh Initial commit for Ads Service. (#21) 2018-08-22 17:02:46 -07:00
gradlew Initial commit for Ads Service. (#21) 2018-08-22 17:02:46 -07:00
gradlew.bat Initial commit for Ads Service. (#21) 2018-08-22 17:02:46 -07:00
README.md Initial commit for Ads Service. (#21) 2018-08-22 17:02:46 -07:00
settings.gradle Initial commit for Ads Service. (#21) 2018-08-22 17:02:46 -07:00

Ad Service

The Ad service provides advertisement based on context keys. If no context keys are provided then it returns random ads.

Local Build

The Ad service uses gradlew to compile/install/distribute. Gradle wrapper is already part of the source code. To build Ad Service, run

    cd src/adservice; ./gradlew installDist

It will create executable script src/adservice/build/install/hipstershop/bin/AdService

Upgrade gradle version

If you need to upgrade the version of gradle then run

    cd src/adservice ; ./gradlew wrapper --gradle-version <new-version>

Docker Build

From repository root, run:

docker build --file src/adservice/Dockerfile .