Keep PG data in image, add DATABASE_URL, add uv symlink, simplify entrypoint
Docker / build-and-push (push) Successful in 1m54s
Docker / build-and-push (push) Successful in 1m54s
This commit is contained in:
+6
-4
@@ -24,21 +24,23 @@ RUN curl -LsSf https://astral.sh/uv/install.sh | sh && \
|
||||
. "$HOME/.local/bin/env" && \
|
||||
uv --version
|
||||
|
||||
RUN ln -sf /root/.local/bin/uv /usr/local/bin/uv
|
||||
|
||||
# ── pnpm ──
|
||||
RUN npm install -g pnpm
|
||||
|
||||
# ── PostgreSQL 16 + pgvector ──
|
||||
RUN apk add --no-cache postgresql postgresql-pgvector
|
||||
|
||||
# ── Init PostgreSQL with dev user/db/ext, then remove data dir to save ~40MB ──
|
||||
# ── Init PostgreSQL with dev user/db/ext, persist data in image ──
|
||||
RUN mkdir -p /run/postgresql && chown postgres:postgres /run/postgresql && \
|
||||
su - postgres -c "initdb -D /var/lib/postgresql/data" && \
|
||||
su - postgres -c "pg_ctl -D /var/lib/postgresql/data start" && \
|
||||
su - postgres -c "psql -c \"CREATE USER remynd WITH PASSWORD 'remynd';\"" && \
|
||||
su - postgres -c "psql -c \"CREATE DATABASE remynd_dev OWNER remynd;\"" && \
|
||||
su - postgres -c "psql -d remynd_dev -c 'CREATE EXTENSION IF NOT EXISTS vector;'" && \
|
||||
su - postgres -c "pg_ctl -D /var/lib/postgresql/data stop" && \
|
||||
rm -rf /var/lib/postgresql/data
|
||||
su - postgres -c "psql -d remynd_dev -c 'CREATE EXTENSION IF NOT EXISTS vector;'"
|
||||
|
||||
ENV DATABASE_URL="postgresql://remynd:remynd@localhost:5432/remynd_dev"
|
||||
|
||||
# ── Ensure uv on PATH for all shells ──
|
||||
RUN echo '. "$HOME/.local/bin/env"' > /root/.profile
|
||||
|
||||
Reference in New Issue
Block a user