Commit 75c31fb 0 parents commit 75c31fb Copy full SHA for 75c31fb
File tree 4 files changed +89
-0
lines changed
4 files changed +89
-0
lines changed Original file line number Diff line number Diff line change
1
+ # syntax=docker/dockerfile:1
2
+
3
+ # Stage 1: Base image
4
+ FROM postgres
5
+
6
+ ENV DEBIAN_FRONTEND=noninteractive POSTGRES_PASSWORD=test1234
7
+
8
+ WORKDIR /
9
+
10
+ # Install dependencies
11
+ RUN apt-get update \
12
+ && apt-get install -y git tmux nala libpq-dev python3.11-dev nginx rabbitmq-server libpq-dev python3.11-venv
13
+
14
+ RUN git clone https://github.com/smlab-niser/tirtha-public.git && cd /tirtha-public && git submodule update --init --recursive
15
+ RUN python3.11 -m venv venv \
16
+ && nala install -y python3-pip && /venv/bin/pip install --upgrade pip setuptools wheel \
17
+ && cd /tirtha-public && /venv/bin/pip install -r ./requirements.txt --default-timeout=2000 \
18
+ && /venv/bin/pip install -e /tirtha-public/tirtha_bk/nn_models/nsfw_model/ && /venv/bin/pip install protobuf==3.20.3 && nala install -y wget unzip && wget https://smlab.niser.ac.in/project/tirtha/static/artifacts/MR2021.1.0.zip \
19
+ && unzip MR2021.1.0.zip && mv ./bin21/ /tirtha-public/tirtha_bk/bin21/ && rm ./MR2021.1.0.zip && wget https://smlab.niser.ac.in/project/tirtha/static/artifacts/ckpt_kadid10k.pt \
20
+ && mv ./ckpt_kadid10k.pt /tirtha-public/tirtha_bk/nn_models/MANIQA/
21
+
22
+ RUN nala install -y npm systemctl nano && npm install -g obj2gltf && wget https://github.com/zeux/meshoptimizer/releases/download/v0.20/gltfpack-ubuntu.zip \
23
+ && unzip gltfpack-ubuntu.zip && chmod +x gltfpack && mv gltfpack /usr/local/bin/ && rm /gltfpack-ubuntu.zip
24
+
25
+ RUN mv /tirtha-public/tirtha_bk/config/tirtha.docker.nginx /tirtha-public/tirtha_bk/config/tirtha.nginx \
26
+ && mv /tirtha-public/tirtha_bk/tirtha_bk/local_settings.docker.py /tirtha-public/tirtha_bk/tirtha_bk/local_settings.py \
27
+ && mv /tirtha-public/tirtha_bk/gunicorn/gunicorn.conf.docker.py /tirtha-public/tirtha_bk/gunicorn/gunicorn.conf.py
28
+
29
+ # COPY ./tirtha-public/tirtha_bk/gunicorn/gunicorn.conf.py /tirtha-public/tirtha_bk/gunicorn/
30
+
31
+ COPY ./init_db.sh /docker-entrypoint-initdb.d
32
+ # COPY ./tirtha /var/www/tirtha
33
+ COPY ./start.sh /
34
+
35
+ RUN chmod +x /docker-entrypoint-initdb.d/init_db.sh && chmod +x /start.sh
Original file line number Diff line number Diff line change
1
+ services :
2
+ cuda :
3
+ container_name : cuda
4
+ image : nvidia/cuda:12.3.1-runtime-ubuntu22.04
5
+ restart : always
6
+ tirtha_repo :
7
+ container_name : tirtha_repo
8
+ build : .
9
+ restart : always
10
+ volumes :
11
+ - type : bind
12
+ source : ./tirtha
13
+ target : /var/www/tirtha
14
+ ports :
15
+ - " 8000:8000"
16
+ - " 15672:15672"
17
+ depends_on :
18
+ - cuda
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ set -e
3
+
4
+ psql -v ON_ERROR_STOP=1 --username " postgres" << -EOSQL
5
+ CREATE DATABASE dbtirtha;
6
+ CREATE USER dbtirthauser WITH PASSWORD 'docker';
7
+ ALTER ROLE dbtirthauser SET client_encoding TO 'utf8';
8
+ ALTER ROLE dbtirthauser SET default_transaction_isolation TO 'read committed';
9
+ ALTER ROLE dbtirthauser SET timezone TO 'UTC';
10
+ ALTER DATABASE dbtirtha OWNER TO dbtirthauser;
11
+ GRANT ALL PRIVILEGES ON DATABASE dbtirtha TO dbtirthauser;
12
+ GRANT CREATE ON SCHEMA public TO dbtirthauser;
13
+ EOSQL
Original file line number Diff line number Diff line change
1
+ #
2
+ cp /tirtha-public/tirtha_bk/config/tirtha.nginx /etc/nginx/sites-available/tirtha
3
+ ln -s /etc/nginx/sites-available/tirtha /etc/nginx/sites-enabled/
4
+ systemctl enable rabbitmq-server
5
+ systemctl start rabbitmq-server
6
+ rabbitmq-plugins enable rabbitmq_management
7
+ rabbitmqctl add_user rmqtirthauser rmqtirthapwd
8
+ rabbitmqctl add_vhost rmqtirtha
9
+ rabbitmqctl set_user_tags rmqtirthauser administrator
10
+ rabbitmqctl set_permissions -p rmqtirtha rmqtirthauser " .*" " .*" " .*"
11
+ rabbitmqctl eval ' application:get_env(rabbit, consumer_timeout).'
12
+ echo " consumer_timeout = 31556952000" | tee -a /etc/rabbitmq/rabbitmq.conf
13
+ systemctl restart rabbitmq-server
14
+ cp tirtha-public/tirtha_bk/tirtha/templates/tirtha/403.html /var/www/tirtha/errors/
15
+ cp tirtha-public/tirtha_bk/tirtha/templates/tirtha/404.html /var/www/tirtha/errors/
16
+ cp tirtha-public/tirtha_bk/tirtha/templates/tirtha/500.html /var/www/tirtha/errors/
17
+ cp tirtha-public/tirtha_bk/tirtha/templates/tirtha/503.html /var/www/tirtha/errors/
18
+ chmod -R 755 /var/www/tirtha/
19
+ chown -R $( whoami) :$( whoami) /var/www/tirtha/
20
+ source /venv/bin/activate
21
+ python /tirtha-public/tirtha_bk/manage.py makemigrations tirtha
22
+ python /tirtha-public/tirtha_bk/manage.py collectstatic
23
+ python /tirtha-public/tirtha_bk/manage.py migrate
You can’t perform that action at this time.
0 commit comments