Skip to content
Open
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
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.19.1
FROM alpine:3.23

ADD target/bundle /lrsql
ADD .java_modules /lrsql/.java_modules
Expand All @@ -8,10 +8,10 @@ RUN apk update \
&& apk upgrade \
&& apk add ca-certificates \
&& update-ca-certificates \
&& apk add --no-cache openjdk11 \
&& apk add --no-cache openjdk25 \
&& mkdir -p /lrsql/runtimes \
&& jlink --output /lrsql/runtimes/linux/ --add-modules $(cat /lrsql/.java_modules) \
&& apk del openjdk11 \
&& apk del openjdk25 \
&& rm -rf /var/cache/apk/*

# delete bench utils for leaner container
Expand Down
62 changes: 62 additions & 0 deletions doc/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,66 @@ CMD ["/lrsql/bin/run_postgres.sh"]

The resulting image will use the provided configuration file and run Postgres. See [Getting Started](startup.md) for more configuration information.

### Building the Docker Image

To build the Docker image locally from source:

#### Prerequisites

- Java 25+ (must match the JDK used in the Dockerfile)
- [Clojure CLI tools](https://clojure.org/guides/install_clojure)
- Docker
- `make`

#### Steps

1. **Download the Admin UI assets:**

``` shell
make resources/public/admin
```

2. **Build the uberjar:**

``` shell
clojure -X:build uber
```

This creates `target/bundle/lrsql.jar`.

3. **Assemble the bundle directory:**

The Dockerfile expects a `target/bundle` directory containing the jar, run scripts and config. You can build the full bundle with:

``` shell
make bundle
```

Or assemble a minimal bundle manually:

``` shell
mkdir -p target/bundle/config
cp -r bin target/bundle/bin
cp resources/lrsql/config/lrsql.json.example target/bundle/config/
cp resources/lrsql/config/authority.json.template target/bundle/config/authority.json.template.example
cp -r resources/public/admin target/bundle/admin
```

4. **Build the Docker image:**

``` shell
docker build -t lrsql .
```

5. **Run it:**

``` shell
docker run -d -p 8080:8080 \
-e LRSQL_API_KEY_DEFAULT=my_key \
-e LRSQL_API_SECRET_DEFAULT=my_secret \
-e LRSQL_ADMIN_USER_DEFAULT=my_username \
-e LRSQL_ADMIN_PASS_DEFAULT=my_password \
lrsql
```

[<- Back to Index](index.md)