Skip to content

Commit

Permalink
Merge pull request #7 from thalesmg/docker-stages
Browse files Browse the repository at this point in the history
ci: shrink docker image
  • Loading branch information
thalesmg authored Oct 23, 2024
2 parents a95530c + 0001bff commit 22cabd2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: test

on: [push]
on: [push, pull_request]

jobs:
test:
Expand Down
11 changes: 10 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
FROM clojure:latest
ARG BUILD_FROM=clojure:latest
ARG RUN_FROM=eclipse-temurin:8u422-b05-jre-noble

FROM ${BUILD_FROM} AS builder

RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
Expand All @@ -7,4 +10,10 @@ COPY . /usr/src/app
RUN clojure -T:build uber && \
mv target/emqx-snowflake-proxy-*-standalone.jar app-standalone.jar

FROM ${RUN_FROM} AS runner

COPY --from=builder /usr/src/app/app-standalone.jar /opt/proxy/app-standalone.jar

WORKDIR /opt/proxy

CMD ["java", "-jar", "app-standalone.jar"]

0 comments on commit 22cabd2

Please sign in to comment.