mirror of
https://github.com/edufeed-org/typesense-indexer.git
synced 2025-12-10 00:34:36 +00:00
Add build options including Docker
This commit is contained in:
parent
26bafba851
commit
d3e60e0179
3 changed files with 75 additions and 2 deletions
32
Dockerfile
Normal file
32
Dockerfile
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
# Stage 1: Build the Uberjar
|
||||
FROM clojure:tools-deps-bullseye AS builder
|
||||
|
||||
# Set environment variables
|
||||
ENV APP_HOME=/usr/src/app
|
||||
WORKDIR $APP_HOME
|
||||
|
||||
# Copy project files
|
||||
COPY deps.edn .
|
||||
COPY build.clj .
|
||||
COPY src ./src
|
||||
COPY resources ./resources
|
||||
|
||||
# Install Git (required for `git-count-revs` in your build script)
|
||||
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Run the build script to create the uberjar
|
||||
RUN clojure -T:build uber
|
||||
|
||||
# Stage 2: Run the Uberjar in a minimal image
|
||||
FROM openjdk:17-jdk-slim
|
||||
|
||||
# Set environment variables
|
||||
ENV APP_HOME=/usr/src/app
|
||||
WORKDIR $APP_HOME
|
||||
|
||||
# Copy the uberjar from the builder stage
|
||||
COPY --from=builder /usr/src/app/target/app.jar app.jar
|
||||
|
||||
# Define the entrypoint
|
||||
ENTRYPOINT ["java", "-jar", "app.jar"]
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue