Skip to content

Commit 6643a05

Browse files
committed
Use pgweb user, update command to only provide additional flags
1 parent c029898 commit 6643a05

4 files changed

Lines changed: 6 additions & 7 deletions

File tree

src/pgweb/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ USER root
55
RUN apt-get update && \
66
apt-get -y install sudo && \
77
apt-get -y clean && \
8-
rm -rf /var/lib/apt/lists/*
8+
rm -rf /var/lib/apt/lists/* && \
9+
mkdir -p /pgweb && \
10+
chown pgweb:pgweb /pgweb
911

1012
USER pgweb

src/pgweb/docker-compose.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@ services:
55
# This can be either a pre-existing image or built from a Dockerfile
66
build:
77
context: .
8-
# Override the default entrypoint to use our custom script
9-
entrypoint: []
10-
command: ["pgweb", "--sessions", "--bind=0.0.0.0", "--listen=8081", "--bookmarks-dir=/root/.pgweb/bookmarks"]
11-
user: "root"
8+
command: ["--sessions", "--bookmarks-dir=/pgweb/bookmarks"]
129
restart: always
1310
volumes:
1411
- .:/workspace:cached

src/pgweb/refresh-bookmarks.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -o nounset
55

66
# Allow overriding via environment for local testing
77
readonly WB_EXE="${WB_EXE:-/usr/bin/wb}"
8-
readonly PGWEB_BASE="${PGWEB_BASE:-/root/.pgweb}"
8+
readonly PGWEB_BASE="${PGWEB_BASE:-/pgweb}"
99
readonly BOOKMARK_DIR="${PGWEB_BASE}/bookmarks"
1010

1111
# Create base directory if it doesn't exist

src/pgweb/start-bookmark-refresh.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ set -o errexit
33
set -o pipefail
44
set -o nounset
55

6-
readonly PGWEB_BASE="${PGWEB_BASE:-/root/.pgweb}"
6+
readonly PGWEB_BASE="${PGWEB_BASE:-/pgweb}"
77

88
echo "Starting bookmark refresh for pgweb..."
99

0 commit comments

Comments
 (0)