Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PostgreSQL #9

Merged
merged 1 commit into from
Dec 4, 2023
Merged
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
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ RUN pnpm run build

FROM nginx:bookworm

RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends postgresql-15 && rm -rf /var/lib/apt/lists/*
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends postgresql-15 && rm -rf /var/lib/apt/lists/* && mv /var/lib/postgresql/15/main /var/lib/

# Copy binaries
COPY --from=rust-builder /build/vss-rs/target/release/vss-rs /app/vss-rs
Expand Down
8 changes: 5 additions & 3 deletions docker_entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ RUST_LOG=debug

#Start and Configure PostgreSQL
echo 'Starting PostgreSQL database server for the first time...'
mkdir -p $POSTGRES_DATADIR $POSTGRES_CONFIG
mv /var/lib/main $POSTGRES_DATADIR
chown -R postgres:postgres $POSTGRES_DATADIR
chown -R postgres:postgres $POSTGRES_CONFIG
chmod -R 700 $POSTGRES_DATADIR
Expand All @@ -30,9 +32,9 @@ RUST_LOG=debug
echo 'Granting db permissions...'
su - postgres -c 'psql -c "grant all privileges on database '$POSTGRES_DB' to '$POSTGRES_USER';"'
echo 'Creating .pgpass file...'
su - postgres -c 'echo "localhost:5432:'$POSTGRES_USER':'$POSTGRES_PASSWORD'" >> .pgpass'
su - postgres -c "chmod -R 0600 .pgpass"
chmod -R 0600 /var/lib/postgresql/.pgpass
echo "localhost:5432:'$POSTGRES_USER':'$POSTGRES_PASSWORD'" > $POSTGRES_DATADIR/../.pgpass
chmod -R 0600 $POSTGRES_DATADIR/../.pgpass
chown postgres:postgres $POSTGRES_DATADIR/../.pgpass

/app/vss-rs &
/app/ln-websocket-proxy &
Expand Down
Loading