Skip to content

Commit

Permalink
build and test monitor from app container
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg Guthe committed May 18, 2021
1 parent 6911d74 commit 4382990
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 38 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Expand Up @@ -26,6 +26,8 @@ ADD version.json /app

RUN cd /app/src/autograph && go install .

RUN cd /app/src/autograph/tools/autograph-monitor && go build -o /go/bin/autograph-monitor .

USER app
WORKDIR /app
CMD /go/bin/autograph
8 changes: 5 additions & 3 deletions docker-compose.yml
Expand Up @@ -66,9 +66,11 @@ services:

monitor:
container_name: autograph-monitor
image: autograph-monitor
build:
context: tools/autograph-monitor/
image: autograph-app
command:
[
"/go/bin/autograph-monitor",
]

monitor-lambda-emulator:
container_name: autograph-monitor-lambda-emulator
Expand Down
25 changes: 0 additions & 25 deletions tools/autograph-monitor/Dockerfile

This file was deleted.

14 changes: 4 additions & 10 deletions tools/autograph-monitor/Dockerfile.lambda-emulator
@@ -1,18 +1,12 @@
FROM autograph-app as app
FROM autograph-monitor
FROM autograph-app

USER root

COPY --from=app /app/src/autograph/bin/test_monitor.sh /usr/local/bin/test_monitor.sh

RUN apt update \
&& \
apt -y install curl \
&& \
curl -Lo /usr/local/bin/aws-lambda-rie \
RUN cp /app/src/autograph/bin/test_monitor.sh /usr/local/bin/test_monitor.sh
RUN curl -Lo /usr/local/bin/aws-lambda-rie \
https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie \
&& \
chmod +x /usr/local/bin/aws-lambda-rie /usr/local/bin/test_monitor.sh

USER app
CMD ["/usr/local/bin/aws-lambda-rie", "/usr/bin/autograph-monitor"]
CMD ["/usr/local/bin/aws-lambda-rie", "/go/bin/autograph-monitor"]

0 comments on commit 4382990

Please sign in to comment.