Skip to content

Commit

Permalink
Merge pull request #15 from sonnh-uit/dev
Browse files Browse the repository at this point in the history
Publish container image
  • Loading branch information
sonnh-uit authored Oct 16, 2024
2 parents b892812 + fa7ac91 commit b0425bb
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 12 deletions.
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@ or
sudo docker-compose up
```
<!-- USAGE EXAMPLES -->
<!-- ## Usage -->
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
Expand Down
22 changes: 22 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -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
11 changes: 4 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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"]
- ./pdf:/app/result
Binary file renamed thesis.pdf → pdf/thesis.pdf
Binary file not shown.

0 comments on commit b0425bb

Please sign in to comment.