File tree 5 files changed +23
-12
lines changed
5 files changed +23
-12
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,17 @@ COPY docker_autostart.sh /usr/local/bin/init_textpair_db
14
14
COPY textpair /textpair/textpair
15
15
16
16
RUN apt update && apt install -y postgresql postgresql-contrib curl git locales libpq-dev python3-pip sudo ripgrep liblz4-tool && curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash && apt-get install -y nodejs && apt-get clean && rm -rf /var/lib/apt && cd /textpair && ./install.sh && mkdir -p /var/www/html/text-pair && echo "[WEB_APP]\n web_app_path = /var/www/html/text-pair\n api_server = http://localhost/text-pair-api\n [DATABASE]\n database_name = textpair\n database_user = textpair\n database_password = textpair" > /etc/text-pair/global_settings.ini && sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen
17
+ RUN mkdir /etc/philologic && echo 'database_root = "/var/www/html/philologic"\n url_root = "http://localhost/philologic/"\n web_app_dir = "/var/lib/philologic4/web_app/"' > /etc/philologic/philologic4.cfg
18
+
19
+ USER postgres
20
+ RUN service postgresql start && sleep 5 && \
21
+ psql --command "CREATE DATABASE textpair;" && \
22
+ psql --command "CREATE ROLE textpair WITH LOGIN PASSWORD 'textpair';" && \
23
+ psql --command "GRANT ALL PRIVILEGES ON DATABASE textpair TO textpair;" && \
24
+ psql -d textpair --command "CREATE EXTENSION pg_trgm;" && \
25
+ perl -pi -e 's/^(local.*)peer$/$1 md5/;' /etc/postgresql/14/main/pg_hba.conf
26
+
27
+ USER root
17
28
ENV LANG en_US.UTF-8
18
29
ENV LANGUAGE en_US:en
19
30
ENV LC_ALL en_US.UTF-8
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ CERTFILE=
13
13
14
14
if [ -z " $KEYFILE " ]
15
15
then
16
- gunicorn -k uvicorn.workers.UvicornWorker -b :$PORT -w 4 --access-logfile=/var/lib/text-pair/api_server/access.log --error-logfile=/var/lib/text-pair/api_server/error.log --chdir /var/lib/text-pair/api/ text_pair:app
16
+ /var/lib/text-pair/textpair_env/bin/ gunicorn -k uvicorn.workers.UvicornWorker -b :$PORT -w 4 --access-logfile=/var/lib/text-pair/api_server/access.log --error-logfile=/var/lib/text-pair/api_server/error.log --chdir /var/lib/text-pair/api/ text_pair:app
17
17
else
18
- gunicorn --keyfile=$KEYFILE --certfile=$CERTFILE -k uvicorn.workers.UvicornWorker -b :$PORT -w 4 --access-logfile=/var/lib/text-pair/api_server/access.log --error-logfile=/var/lib/text-pair/api_server/error.log --chdir /var/lib/text-pair/api/ text_pair:app
18
+ /var/lib/text-pair/textpair_env/bin/ gunicorn --keyfile=$KEYFILE --certfile=$CERTFILE -k uvicorn.workers.UvicornWorker -b :$PORT -w 4 --access-logfile=/var/lib/text-pair/api_server/access.log --error-logfile=/var/lib/text-pair/api_server/error.log --chdir /var/lib/text-pair/api/ text_pair:app
19
19
fi
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
# Copied to docker container and run as command
3
3
4
- if [ ! -d " /data/psql_data" ]; then
5
- su postgres << 'EOF '
6
- service postgresql start
7
- psql -c "create database textpair"
8
- psql -d textpair -c "create extension pg_trgm;"
9
- psql -c "create role textpair with login password 'textpair';"
10
- psql -c "GRANT ALL PRIVILEGES ON database textpair to textpair;"
11
- EOF
12
- perl -pi -e ' s/^(local.*)peer$/$1 md5/;' /etc/postgresql/14/main/pg_hba.conf
4
+ # if [ ! -d "/data/psql_data" ]; then
5
+ # su postgres <<'EOF'
6
+ # service postgresql start
7
+ # psql -c "create database textpair"
8
+ # psql -d textpair -c "create extension pg_trgm;"
9
+ # psql -c "create role textpair with login password 'textpair';"
10
+ # psql -c "GRANT ALL PRIVILEGES ON database textpair to textpair;"
11
+ # EOF
12
+ # perl -pi -e 's/^(local.*)peer$/$1 md5/;' /etc/postgresql/14/main/pg_hba.conf
13
13
su postgres << 'EOF '
14
14
service postgresql restart
15
15
EOF
Original file line number Diff line number Diff line change 15
15
"sentence-transformers" ,
16
16
"lz4" ,
17
17
"orjson" ,
18
- "text_preprocessing @ git+https://github.com/ARTFL-Project/text-preprocessing@v1.0.5 #egg=text_preprocessing" ,
18
+ "text_preprocessing @ git+https://github.com/ARTFL-Project/text-preprocessing@v1.1.0.1 #egg=text_preprocessing" ,
19
19
"fastapi==0.110.3" ,
20
20
"psycopg2" ,
21
21
"gunicorn" ,
You can’t perform that action at this time.
0 commit comments