Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
initialize postgres in .devcontainer
- Loading branch information
1 parent
c8052b5
commit 8ae3ad8
Showing
2 changed files
with
25 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,30 @@ | ||
FROM mcr.microsoft.com/vscode/devcontainers/base:debian-10 | ||
FROM mcr.microsoft.com/vscode/devcontainers/universal:1-linux | ||
|
||
ENV DENO_INSTALL=/deno | ||
RUN mkdir -p /deno | ||
RUN curl -fsSL https://deno.land/x/install/install.sh | sh | ||
USER root | ||
|
||
ENV PATH="${DENO_INSTALL}/bin:${PATH}" | ||
RUN mkdir -p /deno && \ | ||
curl -fsSL https://deno.land/x/install/install.sh | DENO_INSTALL=/deno sh && \ | ||
chown -R codespace /deno | ||
|
||
ENV DENO_INSTALL="/deno" | ||
ENV DENO_DIR="${DENO_INSTALL}/.cache/deno" | ||
ENV PATH="${PATH}:${DENO_INSTALL}/bin:/usr/lib/postgresql/12/bin" | ||
ENV PGDATA="/usr/local/pgsql/data" | ||
|
||
RUN apt-get update && \ | ||
apt-get -y install postgresql-12 postgresql-client-12 && \ | ||
mkdir -p /usr/local/pgsql/data && \ | ||
chown postgres /usr/local/pgsql/data | ||
|
||
USER postgres | ||
|
||
ENV DENO_INSTALL="/deno" | ||
ENV DENO_DIR="${DENO_INSTALL}/.cache/deno" | ||
ENV PATH="${PATH}:${DENO_INSTALL}/bin:/usr/lib/postgresql/12/bin" | ||
ENV PGDATA="/usr/local/pgsql/data" | ||
|
||
RUN chown -R vscode /deno | ||
RUN initdb && \ | ||
pg_ctl start && \ | ||
createuser -s vscode | ||
|
||
ENV EDITOR="code --wait" | ||
USER codespace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters