diff --git a/Dockerfile b/Dockerfile index aab2aae..1b2245e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,10 +3,13 @@ FROM ubuntu:latest ENV DEBIAN_FRONTEND=noninteractive # Update the system and install LaTeX dependencies -RUN apt-get update && apt-get upgrade -y && \ +RUN apt-get update -y && \ apt-get install -y texlive-latex-extra texlive-lang-all \ texlive-bibtex-extra biber WORKDIR /app -COPY . . -ENTRYPOINT ["bash", "-c", "pdflatex thesis.tex && biber thesis && pdflatex thesis.tex"] +ADD . /app +RUN mkdir -p /app/result +VOLUME /app/result +RUN chmod +x /app/build.sh +CMD ["/app/build.sh" ] diff --git a/README.md b/README.md index 6177a4b..3991afd 100644 --- a/README.md +++ b/README.md @@ -101,8 +101,7 @@ or sudo docker-compose up ``` - - +Container will create `pdf` folder and your thesis file on there. ## DEMO - The gifs bellow display step by step to use this project in Overleaf diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..4772956 --- /dev/null +++ b/build.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +WORK_DIR="/app" +RESULT_DIR="$WORK_DIR/result" + +check_env() { + echo "$FACULTY" +} + +build_project() { + cd $WORK_DIR + pdflatex thesis.tex && biber thesis && pdflatex thesis.tex + mv thesis.pdf $RESULT_DIR/ + +} + +main() { + check_env + build_project +} + +main \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 0daef68..702cab3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,10 +1,7 @@ version: '3' services: - thesis-build: - build: - context: . - dockerfile: Dockerfile + my-thesis: + container_name: my-thesis-template + image: quay.io/sonnh-uit/hcmuit-thesis volumes: - - .:/app - working_dir: /app - # command: ["echo", "thesis.tex", "|", "/app", "-r", "pdflatex thesis.tex && biber thesis && pdflatex thesis.tex"] \ No newline at end of file + - ./pdf:/app/result \ No newline at end of file diff --git a/thesis.pdf b/pdf/thesis.pdf similarity index 88% rename from thesis.pdf rename to pdf/thesis.pdf index 540cdcb..a95c4ed 100644 Binary files a/thesis.pdf and b/pdf/thesis.pdf differ