Skip to content

Commit d45b5d8

Browse files
committed
Address Stefans changes
1 parent 1ff79f5 commit d45b5d8

File tree

5 files changed

+61
-39
lines changed

5 files changed

+61
-39
lines changed

Images/qiita/Dockerfile

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
1-
FROM ubuntu:22.04
1+
FROM ubuntu:24.04
22

33
ARG MINIFORGE_VERSION=24.1.2-0
44

55
ENV CONDA_DIR=/opt/conda
66
ENV PATH=${CONDA_DIR}/bin:${PATH}
77

88
RUN apt-get -y update
9-
RUN apt-get -y install \
9+
RUN apt-get -y --fix-missing install \
1010
git \
11-
wget
11+
wget \
12+
libpq-dev \
13+
python3-dev \
14+
gcc
1215
RUN apt-get -y install build-essential
1316
# install miniforge3 for "conda"
1417
# see https://github.com/conda-forge/miniforge-images/blob/master/ubuntu/Dockerfile
@@ -31,36 +34,32 @@ RUN pip install \
3134
sphinx-bootstrap-theme \
3235
nose-timer \
3336
Click \
34-
coverage
37+
coverage \
38+
psycopg2-binary
3539

36-
#Clone the Qiita Repo
37-
#RUN git clone -b master https://github.com/qiita-spots/qiita.git
40+
#cClone the Qiita Repo
41+
# RUN git clone -b master https://github.com/qiita-spots/qiita.git
3842
RUN git clone -b auth_oidc https://github.com/jlab/qiita.git
3943

40-
#We need to install necessary dependencies
41-
#as well as some extra dependencies for psycopg2 to work
44+
# We need to install necessary dependencies
45+
# as well as some extra dependencies for psycopg2 to work
4246
RUN git clone https://github.com/psycopg/psycopg2.git
43-
RUN apt-get -y update
44-
RUN apt-get -y install libpq-dev python3-dev gcc
45-
RUN pg_config --version
4647
RUN export PATH=/usr/lib/postgresql/14.11/bin/:$PATH
47-
RUN pip install psycopg2-binary
4848
RUN pip install -e psycopg2/.
4949

50-
#Install pip packaages for Qiita
51-
RUN pip install -e qiita/. --no-binary redbiom
52-
RUN pip install "Jinja2<3.1"
50+
# Install pip packaages for Qiita
51+
RUN pip install -e qiita --no-binary redbiom
5352

5453

55-
#Copy modified config file to the container
54+
# Copy modified config file to the container
5655
COPY config_qiita_oidc.cfg .
57-
RUN chmod 777 config_qiita_oidc.cfg
56+
RUN chmod 755 config_qiita_oidc.cfg
5857

59-
#Copy Bash Script to run Qiita to the container
58+
# Copy Bash Script to run Qiita to the container
6059
COPY start_qiita.sh .
61-
RUN chmod 777 start_qiita.sh
60+
RUN chmod 755 start_qiita.sh
6261

63-
#I will leave this ENTRYPOINT here as a comment in case debugging
64-
#is necessary
65-
#ENTRYPOINT ["/bin/bash"]
62+
# I will leave this ENTRYPOINT here as a comment in case debugging
63+
# is necessary
64+
# SHELL ["/bin/bash"]
6665
ENTRYPOINT ["conda", "run", "-n", "qiita", "./start_qiita.sh"]

Images/qiita/start_qiita.sh

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
#!/bin/bash
22

3-
#first we start the redis server
3+
# first we start the redis server
44
redis-server --daemonize yes --port 7777
55
redis-server --daemonize yes --port 6379
66

7-
export QIITA_CONFIG_FP="./config_qiita_oidc.cfg"
7+
export QIITA_CONFIG_FP="/config_qiita_oidc.cfg"
88

9-
#building the database without ontologies
10-
qiita-env make --no-load-ontologies
9+
conda list
1110

12-
#starting the webserver without building the docs
13-
qiita pet webserver --no-build-docs start
11+
# building the database without ontologies
12+
qiita-env make --no-load-ontologies #|| true
13+
14+
# starting the webserver without building the docs
15+
qiita pet webserver --no-build-docs start
16+
17+
# supervisord -c ./qiita/qiita_pet/supervisor_example.conf

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
**IMPORTANT: Have docker installed!**
2+
**THIS VERSION CURRENTLY ONLY WORKS WITH DOCKER, NOT WITH PODMAN**
3+
**FOR TESTING ON LOCAL MACHINES**
24

35
### Hopefully "foolproof" instructions:
46
1. Clone repository
@@ -16,7 +18,7 @@
1618
2. Run `docker compose up keycloak_web keycloakdb`
1719
3. Open `http://localhost:8080`, login admin pw admin
1820
4. Configure Qiita as a service, create a user
19-
5. Edit `config_qiita_oidc.cfg` to fit your local Keycloak configuration, comment out necessary oidc configuration part.
21+
5. Edit `config_qiita_oidc.cfg` to fit your local Keycloak configuration, remove # from necessary oidc block.
2022
6. Open a new terminal, move into Image Folder `cd Images/qiita`
2123
7. Build docker image `docker build . -f qiita/Dockerfile -t qiita`
2224
8. Move to folder containing compose file `cd ../..`

compose.yaml

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ services:
1010
environment:
1111
- POSTGRES_DB=postgres
1212
- POSTGRES_USER=postgres
13-
- POSTGRES_DB_NAME=postgres
14-
- POSTGRES_DB_USER=postgres
1513
volumes:
1614
- './environments/qiita-db-init.sh:/docker-entrypoint-initdb.d/qiita-db-init.sh'
1715
- 'postgres-data:/var/lib/postgresql/data'
@@ -20,22 +18,26 @@ services:
2018

2119
qiita:
2220
image: qiita:latest
23-
command: ['./start_qiita.sh'] #executes bash script inside the container
21+
command: ['./start_qiita.sh'] # executes bash script inside the container
22+
# entrypoint: /bin/bash
2423
stdin_open: true
2524
tty: true
2625
network_mode: host
2726
ports:
28-
- "21174:21174" #wihtout nginx
27+
- "21174:21174" # wihtout nginx
2928
restart: no
3029
depends_on:
3130
- qiita-db
3231
env_file:
3332
- './environments/qiita.env'
3433
environment:
3534
- QIITA_ROOTCA_CERT=/qiita/qiita_core/support_files/ci_rootca.crt
36-
- QIITA_CONFIG_FP=./config_qiita_oidc.cfg
35+
- QIITA_CONFIG_FP=/config_qiita_oidc.cfg
36+
volumes:
37+
- qiita-data:/qiita
3738

38-
keycloak_web: #from https://stackoverflow.com/questions/78071458/keycloak-docker-compose
39+
40+
keycloak_web: # from https://stackoverflow.com/questions/78071458/keycloak-docker-compose
3941
image: quay.io/keycloak/keycloak:24.0.2
4042
container_name: keycloak_web
4143
environment:
@@ -45,7 +47,7 @@ services:
4547
KC_DB_PASSWORD: password
4648

4749
KC_HOSTNAME: localhost
48-
KC_HOSTNAME_PORT: 8080
50+
KC_HOSTNAME_PORT: 9999
4951
KC_HOSTNAME_STRICT: false
5052
KC_HOSTNAME_STRICT_HTTPS: false
5153

@@ -58,7 +60,7 @@ services:
5860
depends_on:
5961
- keycloakdb
6062
ports:
61-
- 8080:8080
63+
- 9999:8080
6264

6365
keycloakdb:
6466
image: postgres:15
@@ -68,9 +70,24 @@ services:
6870
POSTGRES_DB: keycloak
6971
POSTGRES_USER: keycloak
7072
POSTGRES_PASSWORD: password
73+
74+
# nginx:
75+
# image: nginx_qiita:latest
76+
# ports:
77+
# - "8080:8080"
78+
# command: ['./start_nginx.sh']
79+
# command: /bin/bash
80+
# entrypoint: /bin/bash
81+
# stdin_open: true
82+
# tty: true
83+
# restart: no
84+
# volumes:
85+
# - qiita:/qiita/
7186

7287
volumes:
7388
postgres-data:
7489
name: qiita-postgres-data
7590
keycloak-postgres-data:
76-
name: keycloak-postgres-data
91+
name: keycloak-postgres-data
92+
qiita-data:
93+
name: qiita-data

environments/qiita-db-init.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ set -e
44
set -u
55

66
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" "$POSTGRES_DB" <<-EOSQL
7-
ALTER DATABASE "$POSTGRES_DB_NAME" OWNER TO "$POSTGRES_USER"
7+
ALTER DATABASE "$POSTGRES_DB" OWNER TO "$POSTGRES_USER"
88
EOSQL

0 commit comments

Comments
 (0)