Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ GOENV=GOOS=linux GOARCH=amd64 CGO_ENABLED=0 GO111MODULE=on
db/db: db/*.go
env $(GOENV) go build -o $@ ./db

app/app: app/*.go
env $(GOENV) go build -o $@ ./app

loadgen/loadgen: loadgen/*.go
env $(GOENV) go build -o $@ ./loadgen

Expand All @@ -26,7 +23,7 @@ db/.uptodate: db/db db/Dockerfile
docker tag $(DOCKER_IMAGE_BASE)/tns-db $(DOCKER_IMAGE_BASE)/tns-db:$(IMAGE_TAG)
touch $@

app/.uptodate: app/app app/Dockerfile app/index.html.tmpl
app/.uptodate: app/Dockerfile app/pom.xml $(shell find app/src)
docker build -t $(DOCKER_IMAGE_BASE)/tns-app app/
docker tag $(DOCKER_IMAGE_BASE)/tns-app $(DOCKER_IMAGE_BASE)/tns-app:$(IMAGE_TAG)
touch $@
Expand Down
22 changes: 16 additions & 6 deletions app/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
FROM alpine:3.9
ADD app /
ADD index.html.tmpl /
EXPOSE 80
ENTRYPOINT [ "/app" ]
CMD [ "http://db" ]
FROM maven:3.6.3-openjdk-11 as build
WORKDIR /usr/src/app

# We copy the pom and install the dependencies as a sepearate step so docker will cache them.
COPY pom.xml /usr/src/app
RUN mvn dependency:resolve

# Now actually build the thing.
COPY src /usr/src/app/src
RUN mvn install -Dmaven.test.skip=true


FROM tomcat:9-jre11
RUN curl -L -o /usr/local/tomcat/opentelemetry-javaagent-all.jar https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v0.15.1/opentelemetry-javaagent-all.jar
COPY --from=build /usr/src/app/target/News.war /usr/local/tomcat/webapps/News.war
ENV JAVA_OPTS="-javaagent:/usr/local/tomcat/opentelemetry-javaagent-all.jar -Dlogging.level.org.springframework.web.filter.CommonsRequestLoggingFilter=DEBUG '-Dlogging.pattern.console=%d{yyyy-MM-dd HH:mm:ss} - %logger{36} - %msg traceID=%X{traceId} %n'"
72 changes: 0 additions & 72 deletions app/index.html.tmpl

This file was deleted.

Loading