Skip to content

Commit 34e06bd

Browse files
committed
Upgrade superset-db based on postgres:12-bullseye image
1 parent a8b3d0a commit 34e06bd

6 files changed

Lines changed: 16 additions & 795 deletions

File tree

docker-compose.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,10 @@ services:
107107
superset-db:
108108
build: superset-db
109109
container_name: superset-db
110-
ports:
111-
- "5433:5432"
112-
volumes:
113-
- superset-db:/var/lib/pgsql/9.6/data
114-
user: postgres
115110
environment:
111+
- POSTGRES_USER=superset
112+
- POSTGRES_PASSWORD=superset
113+
- POSTGRES_DB=superset
116114
- LRS_HOST=learninglocker_mongo
117115
- LRS_PORT=27017
118116
- LRS_DB=learninglocker
@@ -125,6 +123,9 @@ services:
125123
- LRW_DB_USER=caliper
126124
- LRW_DB_PASSWORD=caliper
127125
- LRW_COLLECTION=mongoEvent
126+
volumes:
127+
- ./superset-db/init:/docker-entrypoint-initdb.d
128+
- superset-db:/var/lib/postgresql/data
128129
jupyterhub:
129130
build: jupyterhub
130131
container_name: jupyterhub

superset-db/Dockerfile

Lines changed: 7 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,16 @@
1-
FROM centos:centos7
1+
FROM postgres:12-bullseye
22

3-
LABEL version="2.3.3"
3+
LABEL version="3.0.0"
44

55
# Install dependencies
6-
RUN yum update -y && \
7-
yum install -y \
8-
gcc \
9-
gcc-c++ \
6+
RUN apt update && \
7+
apt install -y \
108
git \
11-
make \
12-
python-devel \
13-
which
14-
15-
# Install pip and setuptools
16-
RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py && \
17-
python get-pip.py
18-
19-
# Install PostgreSQL 9.6
20-
COPY pgdg-96.repo /etc/yum.repos.d/
21-
RUN yum install -y \
22-
postgresql96-contrib \
23-
postgresql96-devel \
24-
postgresql96-server
25-
26-
# Add path to commands
27-
ENV PATH $PATH:/usr/pgsql-9.6/bin
28-
29-
# Install Multicorn
30-
WORKDIR /usr/local/src
31-
RUN git clone https://github.com/Kozea/Multicorn.git --depth 1 -b v1.4.0 && \
32-
cd Multicorn && \
33-
make && make install
9+
postgresql-12-python3-multicorn \
10+
python3-setuptools
3411

3512
# Install yam_fdw
3613
WORKDIR /usr/local/src
3714
RUN git clone https://github.com/udzuki/yam_fdw.git && \
3815
cd yam_fdw && \
39-
python setup.py install
40-
41-
# Prepare init scripts
42-
USER postgres
43-
ENV PGDATA /var/lib/pgsql/9.6/data
44-
COPY --chown=postgres:postgres \
45-
entrypoint.sh pg_hba.conf postgresql.conf setup.sh /init/
46-
RUN chmod 755 /init/entrypoint.sh /init/setup.sh
47-
EXPOSE 5432
48-
ENTRYPOINT ["/init/entrypoint.sh"]
49-
CMD ["postgres"]
16+
python3 setup.py install
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
#!/usr/bin/env bash
2+
set -e
23

3-
psql -p $1 << EOF
4-
/* Create database used to store Superset users, etc. */
5-
CREATE DATABASE superset;
6-
4+
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
75
/* Create database used to store data analysis results done with JupyterHub */
86
CREATE DATABASE jupyter;
97
@@ -134,4 +132,4 @@ CREATE FOREIGN TABLE caliper_statements (
134132
password '$LRW_DB_PASSWORD',
135133
collection '$LRW_COLLECTION'
136134
);
137-
EOF
135+
EOSQL

superset-db/pg_hba.conf

Lines changed: 0 additions & 95 deletions
This file was deleted.

superset-db/pgdg-96.repo

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)