Skip to content

Commit

Permalink
Improve path and file names in Docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
oneonestar committed Feb 20, 2025
1 parent c27e890 commit e0493ae
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
12 changes: 6 additions & 6 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ RUN \
curl -#LfS "${JDK_DOWNLOAD_LINK}" | tar -zx --strip 1 -C "${JAVA_HOME}"

FROM ${TRINO_GATEWAY_BASE_IMAGE}
WORKDIR /opt/trino
WORKDIR /opt/trino-gateway

ARG JDK_VERSION
ENV JAVA_HOME="/usr/lib/jvm/jdk-${JDK_VERSION}"
Expand All @@ -40,14 +40,14 @@ RUN \
microdnf install -y tar less shadow-utils && \
groupadd trino --gid 1000 && \
useradd trino --uid 1000 --gid 1000 --create-home && \
mkdir -p /usr/lib/trino && \
chown -R "trino:trino" /usr/lib/trino /opt/trino
mkdir -p /usr/lib/trino-gateway && \
chown -R "trino:trino" /usr/lib/trino-gateway /opt/trino-gateway

COPY --chown=trino:trino gateway-ha /usr/lib/trino
COPY --chown=trino:trino gateway-ha /usr/lib/trino-gateway

EXPOSE 8080
USER trino:trino
CMD java -jar /usr/lib/trino/gateway-ha-jar-with-dependencies.jar "/opt/trino/gateway-ha-config.yml"
CMD java -jar /usr/lib/trino-gateway/gateway-ha-jar-with-dependencies.jar "/opt/trino-gateway/config.yaml"

HEALTHCHECK --interval=10s --timeout=5s --start-period=10s \
CMD /usr/lib/trino/bin/health-check
CMD /usr/lib/trino-gateway/bin/health-check
2 changes: 1 addition & 1 deletion docker/bin/health-check
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function get_property() {
grep "$1" "$2" | cut -d':' -f2 | tr -d '[:space:]' || true
}

config=/opt/trino/gateway-ha-config.yml
config=/opt/trino-gateway/config.yaml
scheme=http
port=8080

Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ services:
postgres:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "/usr/lib/trino/bin/health-check || exit 1"]
test: ["CMD-SHELL", "/usr/lib/trino-gateway/bin/health-check || exit 1"]
interval: 5s
timeout: 5s
retries: 60
start_period: 20s
ports:
- "8080:8080"
volumes:
- target: /opt/trino/gateway-ha-config.yml
source: ../gateway-ha/gateway-ha-config-docker.yml
- target: /opt/trino-gateway/config.yaml
source: ./config.yaml
type: bind

postgres:
Expand Down
8 changes: 4 additions & 4 deletions docs/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,11 @@ details found in the `docker-compose.yml` file.

## Configuration

The image uses the configuration file `gateway-ha/gateway-ha-config-docker.yml`
from the project checkout, and mounts it at `/opt/trino/gateway-ha-config.yml`.
The image uses the configuration file `docker/config.yaml` from the project
checkout, and mounts it at `/opt/trino-gateway/config.yaml`.

## Health check

By default the container health check uses the file `docker/bin/health-check`
mounted at `/usr/lib/trino/bin/health-check`. The scripts expects a 2XX response
from the server at `/api/public/backends`.
mounted at `/usr/lib/trino-gateway/bin/health-check`. The scripts expects a 2XX
response from the server at `/api/public/backends`.

0 comments on commit e0493ae

Please sign in to comment.