Skip to content
Snippets Groups Projects
Commit 3434c5e5 authored by Martin Jeppesen's avatar Martin Jeppesen
Browse files

Attempt to make it compile on Ubuntu

parent 18cbd68c
Branches
No related tags found
No related merge requests found
FROM dtucompute/sharelatex-enote:v2 FROM dtucompute/sharelatex:2018
LABEL github="https://github.com/dtu-compute/dtu-enote-getpdf" LABEL github="https://github.com/dtu-compute/dtu-enote-getpdf"
LABEL version="2018" LABEL version="2018"
...@@ -7,59 +7,52 @@ for the get-pdf project." ...@@ -7,59 +7,52 @@ for the get-pdf project."
ARG TZ=Europe/Copenhagen ARG TZ=Europe/Copenhagen
# Set timezone RUN apt-get -y -qq install build-essential nano nginx openssh-server git openssh-client curl openssl \
RUN sudo cp /usr/share/zoneinfo/$TZ /etc/localtime libreadline-dev curl zlib1g zlib1g-dev libssl-dev libyaml-dev \
RUN sudo bash -l -c 'echo "${TZ}" > /etc/timezone' libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev \
automake libtool bison pkg-config gnupg2
RUN rm -rf /etc/service/* /etc/my_init.d/* RUN apt-get -y -qq install parallel
RUN ln -s /bin/bash /usr/bin/bash RUN cp /usr/bin/parallel /tmp
RUN apt-get -y -qq install moreutils
RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config RUN mv /tmp/parallel /usr/bin/
RUN sed -ri 's/#?LogLevel INFO/LogLevel VERBOSE/' /etc/ssh/sshd_config
COPY get-pdf.sh / COPY get-pdf.sh /
COPY mod_caption.rb / COPY mod_caption.rb /
COPY run-server.sh / COPY run-server.sh /
# basics RUN ln -s /bin/bash /usr/bin/bash
RUN apt-get install -y nginx openssh-server git openssh-client curl
RUN apt-get install -y nano
RUN apt-get install -y build-essential
RUN apt-get install -y openssl libreadline6 libreadline6-dev curl zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison pkg-config
RUN apt-get install -y gnupg2
# install RVM, Ruby, and Bundler RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
RUN gpg2 --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 RUN sed -ri 's/#?LogLevel INFO/LogLevel VERBOSE/' /etc/ssh/sshd_config
RUN \curl -L https://get.rvm.io | bash -s stable
RUN /bin/bash -l -c "rvm requirements"
RUN /bin/bash -l -c "rvm install 2.2.4"
RUN /bin/bash -l -c "gem install bundler --no-ri --no-rdoc"
RUN echo "source /etc/profile.d/rvm.sh" >> ~/.bashrc
RUN apt-get -y install parallel ## install RVM, Ruby, and Bundler
RUN cp /usr/bin/parallel /tmp #RUN gpg2 --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
RUN apt-get -y install moreutils #RUN \curl -L https://get.rvm.io | bash -s stable
RUN mv /tmp/parallel /usr/bin/ #RUN /bin/bash -l -c "rvm requirements"
#RUN /bin/bash -l -c "rvm install 2.2.4"
#RUN /bin/bash -l -c "gem install bundler --no-ri --no-rdoc"
#RUN echo "source /etc/profile.d/rvm.sh" >> ~/.bashrc
RUN ln -s /usr/local/texlive/2017/bin/x86_64-linux/pdflatex /usr/bin/ RUN apt-get -y -qq install ruby ruby-bundler
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash #RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
RUN mkdir /getpdf-server RUN mkdir /getpdf-server
COPY getpdf-server /getpdf-server COPY getpdf-server /getpdf-server
WORKDIR /getpdf-server WORKDIR /getpdf-server
ENV NVM_DIR /root/.nvm #ENV NVM_DIR /root/.nvm
ENV NODE_VERSION --lts #ENV NODE_VERSION --lts
RUN . $NVM_DIR/nvm.sh \ #RUN . $NVM_DIR/nvm.sh \
&& nvm install $NODE_VERSION \ # && nvm install $NODE_VERSION \
&& nvm use default \ # && nvm use default \
&& npm install \ # && npm install \
&& npm run build \ # && npm run build \
&& npm install forever -g # && npm install forever -g
WORKDIR . WORKDIR .
ENTRYPOINT ["/bin/bash", "-l", "-c", "/run-server.sh"] ENTRYPOINT ["/bin/bash", "-l", "-c", "/run-server.sh"]
version: '2'
services:
get-pdf: get-pdf:
build: /docker/get-pdf build: .
container_name: get-pdf
expose: expose:
- "22" - "22"
volumes: # volumes:
- /vol/enotes:/enotes # - /vol/enotes:/enotes
- /vol/getpdf-keys:/root/.ssh # - /vol/getpdf-keys:/root/.ssh
#!/bin/bash #!/bin/bash
#!/usr/bin/bash
# /get-pdf.sh 01005 course.zip <jobid> # /get-pdf.sh 01005 course.zip <jobid>
...@@ -16,7 +15,7 @@ export LC_ALL=en_US.UTF-8 ...@@ -16,7 +15,7 @@ export LC_ALL=en_US.UTF-8
rm -rf $project rm -rf $project
mkdir -p $project mkdir -p $project
pdflatex="/usr/local/texlive/2017/bin/x86_64-linux/pdflatex -halt-on-error -interaction=nonstopmode" pdflatex="pdflatex -halt-on-error -interaction=nonstopmode"
echo "/build-pdf.sh $course $course_zip $jobid" echo "/build-pdf.sh $course $course_zip $jobid"
...@@ -63,7 +62,7 @@ if [ $course == 00000 ] || [ $course == 01005 ] || [ $course == 01006 ]; then ...@@ -63,7 +62,7 @@ if [ $course == 00000 ] || [ $course == 01005 ] || [ $course == 01006 ]; then
env src="$SRC" env dst="$DST" perl -i -pe 's/\Q$ENV{src}\E/$ENV{dst}/g' ${FILE%.*}.tex env src="$SRC" env dst="$DST" perl -i -pe 's/\Q$ENV{src}\E/$ENV{dst}/g' ${FILE%.*}.tex
done < ../refs2update done < ../refs2update
for f in *.tex; do cat $f | /usr/local/rvm/rubies/ruby-2.2.4/bin/ruby -0777 -pe '$_.gsub!(/href{[^}]+}/){ |href| href.gsub(%q|#|, %q|\#|) }' | sponge $f; done for f in *.tex; do cat $f | ruby -0777 -pe '$_.gsub!(/href{[^}]+}/){ |href| href.gsub(%q|#|, %q|\#|) }' | sponge $f; done
ls *tex | parallel -j 8 "$pdflatex {}" ls *tex | parallel -j 8 "$pdflatex {}"
...@@ -89,3 +88,4 @@ if [ $course == 02323 ] || [ $course == 02402 ]; then ...@@ -89,3 +88,4 @@ if [ $course == 02323 ] || [ $course == 02402 ]; then
mv /tmp/log.txt $co/ mv /tmp/log.txt $co/
cp -r menu/* $co/ cp -r menu/* $co/
fi fi
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
pushd /getpdf-server pushd /getpdf-server
. $NVM_DIR/nvm.sh #. $NVM_DIR/nvm.sh
# sleep 10
sleep 10
NODE_ENV=production forever --minUptime 1000 --spinSleepTime 10000 start -o ~/getpdf_server_out.log -e ~/getpdf_server_err.log dist/index.js & NODE_ENV=production forever --minUptime 1000 --spinSleepTime 10000 start -o ~/getpdf_server_out.log -e ~/getpdf_server_err.log dist/index.js &
/usr/sbin/sshd -D /usr/sbin/sshd -D
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment