Skip to content

Commit

Permalink
feat: Changed base images
Browse files Browse the repository at this point in the history
Base images now use node-MAJOR versions
  • Loading branch information
seebeen committed Aug 17, 2023
1 parent 4709798 commit ad87284
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:

- name: Clear temporary directory
run: |
rm -rf /tmp/build-digest
rm -rf /tmp/build-digest/*
shell: bash

merge:
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ You would imagine that a company with valuation of $2B could afford to hire a te

```bash
$ docker pull oblakstudio/redisinsight:latest
$ docker run -d --name redisinsight --cap-add=IPC_LOCK -p 5000 oblakstudio/redisinsight:latest
```
> **Warning**
> You need do define the IPC_LOCK capability for the container to work properly. If you don't - you will get an error on startup.

## Environment variables

Expand Down
4 changes: 2 additions & 2 deletions build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM node:18-alpine as front

LABEL org.opencontainers.image.source="https://github.com/oblakstudio/redis-insight-docker" \
LABEL org.opencontainers.image.source="https://github.com/oblakstudio/redisinsight" \
org.opencontainers.image.authors="Oblak Studio <[email protected]>" \
org.opencontainers.image.title="Redis Insight v2" \
org.opencontainers.image.description="Docker Optimized Redis Insight v2" \
Expand Down Expand Up @@ -40,7 +40,7 @@ COPY --from=front /usr/src/app/redisinsight/api/static ./static
COPY --from=front /usr/src/app/redisinsight/api/defaults ./defaults
RUN yarn run build:prod

FROM node:18-bookworm-slim
FROM node:18-slim
ENV DEBIAN_FRONTEND noninteractive
RUN set -ex \
&& apt-get update -y
Expand Down
13 changes: 13 additions & 0 deletions build/docker-entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@
# `docker run`
set -e

if [ -z "$STDOUT_LOGGER" ]; then
export STDOUT_LOGGER=true
fi

if [ -z "$FILES_LOGGER" ]; then
export FILES_LOGGER=false
fi

if [ -z "$GNOME_KEYRING_PASS" ]; then
export GNOME_KEYRING_PASS="redis-team-what-the-hell"
fi


# Launching system's secret storage
eval "$(dbus-launch --sh-syntax)"
mkdir -p ~/.cache
Expand Down
15 changes: 11 additions & 4 deletions src/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18.15.0-alpine as front
FROM node:18-alpine as front

LABEL org.opencontainers.image.source="https://github.com/oblakstudio/redisinsight" \
org.opencontainers.image.authors="Oblak Studio <[email protected]>" \
Expand Down Expand Up @@ -30,7 +30,7 @@ ENV SEGMENT_WRITE_KEY=${SEGMENT_WRITE_KEY}
RUN yarn build:web
RUN yarn build:statics

FROM node:18.15.0-alpine as back
FROM node:18-alpine as back
ENV COMMANDS_TRIGGERS_AND_FUNCTIONS_DEFAULT_URL='https://raw.githubusercontent.com/RedisGears/RedisGears/master/commands.json'
WORKDIR /usr/src/app
COPY redisinsight/api/package.json redisinsight/api/yarn.lock ./
Expand All @@ -40,11 +40,17 @@ COPY --from=front /usr/src/app/redisinsight/api/static ./static
COPY --from=front /usr/src/app/redisinsight/api/defaults ./defaults
RUN yarn run build:prod

FROM node:18.15.0-bullseye-slim
FROM node:18-slim
ENV DEBIAN_FRONTEND noninteractive
RUN set -ex \
&& apt-get update -y
RUN apt-get install net-tools -y
RUN apt-get install -y dbus-x11 gnome-keyring libsecret-1-0
RUN --mount=target=/var/lib/apt/lists,type=cache,sharing=locked \
--mount=target=/var/cache/apt,type=cache,sharing=locked \
rm -f /etc/apt/apt.conf.d/docker-clean \
&& apt-get update \
&& apt-get -y --no-install-recommends install \
dbus-x11 gnome-keyring libsecret-1-0 jq
RUN dbus-uuidgen > /var/lib/dbus/machine-id

ARG NODE_ENV=production
Expand All @@ -64,6 +70,7 @@ COPY --from=front /usr/src/app/redisinsight/ui/dist ./redisinsight/ui/dist

# Build BE prod dependencies here to build native modules
COPY redisinsight/api/package.json redisinsight/api/yarn.lock ./redisinsight/api/
RUN jq 'del(.devDependencies)' redisinsight/api/package.json > tmp.json && mv tmp.json redisinsight/api/package.json
RUN yarn --cwd ./redisinsight/api install --production
COPY redisinsight/api/.yarnclean.prod ./redisinsight/api/.yarnclean
RUN yarn --cwd ./redisinsight/api autoclean --force
Expand Down
6 changes: 5 additions & 1 deletion src/docker-entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,15 @@ if [ -z "$STDOUT_LOGGER" ]; then
export STDOUT_LOGGER=true
fi

# Check if FILES_LOGGER is not defined
if [ -z "$FILES_LOGGER" ]; then
export FILES_LOGGER=false
fi

if [ -z "$GNOME_KEYRING_PASS" ]; then
export GNOME_KEYRING_PASS="redis-team-what-the-hell-are-you-doing"
fi


# Launching system's secret storage
eval "$(dbus-launch --sh-syntax)"
mkdir -p ~/.cache
Expand Down

0 comments on commit ad87284

Please sign in to comment.