-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
136 lines (115 loc) · 3.64 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# Copyright (c) BDist Development Team
# Distributed under the terms of the Modified BSD License.
FROM quay.io/jupyter/minimal-notebook:2024-07-01
LABEL maintainer="Flavio Martins <flavio.f.martins@tecnico.ulisboa.pt>"
# Fix: https://github.com/hadolint/hadolint/wiki/DL4006
# Fix: https://github.com/koalaman/shellcheck/wiki/SC3014
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
USER root
# Create the file repository configuration and Import the repository signing key
RUN echo "deb http://apt.postgresql.org/pub/repos/apt jammy-pgdg main" > /etc/apt/sources.list.d/pgdg.list && \
wget --no-hsts --quiet -O /etc/apt/trusted.gpg.d/pgdg.asc https://www.postgresql.org/media/keys/ACCC4CF8.asc
# Install the PostgreSQL utilities
RUN apt-get update --yes && \
apt-get install --yes --no-install-recommends \
pspg \
postgresql-client-12 \
postgresql-client-13 \
postgresql-client-14 \
postgresql-client-15 \
postgresql-client-16 && \
apt-get clean && rm -rf /var/lib/apt/lists/*
USER ${NB_UID}
# Install PostgreSQL Python drivers
RUN mamba install --yes \
'psycopg' \
'psycopg-c' \
'psycopg-pool' && \
mamba clean --all -f -y && \
fix-permissions "${CONDA_DIR}" && \
fix-permissions "/home/${NB_USER}"
# Install PostgreSQL extras
RUN mamba install --yes \
'pgcli' && \
mamba clean --all -f -y && \
fix-permissions "${CONDA_DIR}" && \
fix-permissions "/home/${NB_USER}"
# Install sqlite
RUN mamba install --yes \
'sqlite' && \
mamba clean --all -f -y && \
fix-permissions "${CONDA_DIR}" && \
fix-permissions "/home/${NB_USER}"
# Install sqlite-utils
RUN mamba install --yes \
'sqlite-utils' && \
mamba clean --all -f -y && \
fix-permissions "${CONDA_DIR}" && \
fix-permissions "/home/${NB_USER}"
# Install redis
RUN mamba install --yes \
'redis-server==7.2.*' \
'redis-py' && \
mamba clean --all -f -y && \
fix-permissions "${CONDA_DIR}" && \
fix-permissions "/home/${NB_USER}"
# Install DuckDB
RUN mamba install --yes \
'duckdb-cli' \
'python-duckdb' && \
mamba clean --all -f -y && \
fix-permissions "${CONDA_DIR}" && \
fix-permissions "/home/${NB_USER}"
# Install DuckDB SQLAlchemy driver
RUN mamba install --yes \
'duckdb-engine' && \
mamba clean --all -f -y && \
fix-permissions "${CONDA_DIR}" && \
fix-permissions "/home/${NB_USER}"
# Install JupySQL
RUN mamba install --yes \
'jupysql' && \
mamba clean --all -f -y && \
fix-permissions "${CONDA_DIR}" && \
fix-permissions "/home/${NB_USER}"
# Install measurement extras
RUN mamba install --yes \
'jupyterlab_execute_time' && \
mamba clean --all -f -y && \
fix-permissions "${CONDA_DIR}" && \
fix-permissions "/home/${NB_USER}"
# Install utility extras
RUN mamba install --yes \
'jupyter-archive' \
'jupyterlab-spellchecker' && \
mamba clean --all -f -y && \
fix-permissions "${CONDA_DIR}" && \
fix-permissions "/home/${NB_USER}"
# Install Python language server
RUN mamba install --yes \
'jupyterlab-lsp' \
'python-lsp-server' \
'python-lsp-ruff' && \
mamba clean --all -f -y && \
fix-permissions "${CONDA_DIR}" && \
fix-permissions "/home/${NB_USER}"
# Install utils
RUN mamba install --yes \
'fd-find' \
'file' \
'git-delta' \
'git-lfs' \
'htop' \
'jc' \
'jq' \
'ncdu' \
'ripgrep' \
'rclone' \
'rsync' && \
mamba clean --all -f -y && \
fix-permissions "${CONDA_DIR}" && \
fix-permissions "/home/${NB_USER}"
USER ${NB_UID}
COPY --chown=${NB_UID}:${NB_GID} ./.psqlrc ${HOME}/.psqlrc
COPY --chown=${NB_UID}:${NB_GID} ./.sqliterc ${HOME}/.sqliterc
WORKDIR "${HOME}"