Big rewrite
This commit is contained in:
38
Dockerfile
38
Dockerfile
@@ -12,10 +12,48 @@ RUN apt-get update && apt-get install -y \
|
||||
fonts-dejavu-extra \
|
||||
fonts-liberation \
|
||||
fonts-liberation2 \
|
||||
fonts-noto \
|
||||
fonts-freefont-ttf \
|
||||
fontconfig \
|
||||
wget \
|
||||
unzip \
|
||||
git \
|
||||
&& fc-cache -f -v \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Download and install select Google Fonts from GitHub
|
||||
RUN mkdir -p /usr/share/fonts/truetype/google-fonts && \
|
||||
cd /tmp && \
|
||||
# Roboto from official release\
|
||||
wget -q https://github.com/google/roboto/releases/download/v2.138/roboto-unhinted.zip && \
|
||||
unzip -q roboto-unhinted.zip -d roboto && \
|
||||
find roboto -name "*.ttf" -path "*/Roboto-Bold.ttf" -exec cp {} /usr/share/fonts/truetype/google-fonts/ \; && \
|
||||
find roboto -name "*.ttf" -path "*/Roboto-Regular.ttf" -exec cp {} /usr/share/fonts/truetype/google-fonts/ \; && \
|
||||
find roboto -name "*.ttf" -path "*/Roboto-Black.ttf" -exec cp {} /usr/share/fonts/truetype/google-fonts/ \; && \
|
||||
# Clone Google Fonts repo for other fonts (shallow clone)\
|
||||
git clone --depth 1 --filter=blob:none --sparse https://github.com/google/fonts.git && \
|
||||
cd fonts && \
|
||||
git sparse-checkout set ofl/opensans ofl/montserrat ofl/oswald ofl/raleway ofl/lato ofl/poppins ofl/anton ofl/bebasneue ofl/ptsans ofl/nunito && \
|
||||
# Copy specific font files\
|
||||
find ofl/opensans -name "OpenSans-Bold.ttf" -o -name "OpenSans-Regular.ttf" -o -name "OpenSans-ExtraBold.ttf" | xargs -I {} cp {} /usr/share/fonts/truetype/google-fonts/ 2>/dev/null || true && \
|
||||
find ofl/opensans -name "OpenSans*\[wght\].ttf" -exec cp {} /usr/share/fonts/truetype/google-fonts/OpenSans-Variable.ttf \; 2>/dev/null || true && \
|
||||
find ofl/montserrat -name "Montserrat-Bold.ttf" -o -name "Montserrat-Regular.ttf" -o -name "Montserrat-Black.ttf" | xargs -I {} cp {} /usr/share/fonts/truetype/google-fonts/ 2>/dev/null || true && \
|
||||
find ofl/montserrat -name "Montserrat*\[wght\].ttf" -exec cp {} /usr/share/fonts/truetype/google-fonts/Montserrat-Variable.ttf \; 2>/dev/null || true && \
|
||||
find ofl/oswald -name "Oswald-Bold.ttf" -o -name "Oswald-Regular.ttf" | xargs -I {} cp {} /usr/share/fonts/truetype/google-fonts/ 2>/dev/null || true && \
|
||||
find ofl/oswald -name "Oswald*\[wght\].ttf" -exec cp {} /usr/share/fonts/truetype/google-fonts/Oswald-Variable.ttf \; 2>/dev/null || true && \
|
||||
find ofl/raleway -name "Raleway-Bold.ttf" -o -name "Raleway-Regular.ttf" -o -name "Raleway-Black.ttf" | xargs -I {} cp {} /usr/share/fonts/truetype/google-fonts/ 2>/dev/null || true && \
|
||||
find ofl/raleway -name "Raleway*\[wght\].ttf" -exec cp {} /usr/share/fonts/truetype/google-fonts/Raleway-Variable.ttf \; 2>/dev/null || true && \
|
||||
find ofl/lato -name "Lato-Bold.ttf" -o -name "Lato-Regular.ttf" -o -name "Lato-Black.ttf" | xargs -I {} cp {} /usr/share/fonts/truetype/google-fonts/ 2>/dev/null || true && \
|
||||
find ofl/poppins -name "Poppins-Bold.ttf" -o -name "Poppins-Regular.ttf" -o -name "Poppins-Black.ttf" | xargs -I {} cp {} /usr/share/fonts/truetype/google-fonts/ 2>/dev/null || true && \
|
||||
find ofl/anton -name "Anton-Regular.ttf" | xargs -I {} cp {} /usr/share/fonts/truetype/google-fonts/ 2>/dev/null || true && \
|
||||
find ofl/bebasneue -name "BebasNeue-Regular.ttf" | xargs -I {} cp {} /usr/share/fonts/truetype/google-fonts/ 2>/dev/null || true && \
|
||||
find ofl/ptsans -name "PTSans-Bold.ttf" -o -name "PTSans-Regular.ttf" | xargs -I {} cp {} /usr/share/fonts/truetype/google-fonts/ 2>/dev/null || true && \
|
||||
find ofl/nunito -name "Nunito-Bold.ttf" -o -name "Nunito-Regular.ttf" -o -name "Nunito-Black.ttf" | xargs -I {} cp {} /usr/share/fonts/truetype/google-fonts/ 2>/dev/null || true && \
|
||||
find ofl/nunito -name "Nunito*\[wght\].ttf" -exec cp {} /usr/share/fonts/truetype/google-fonts/Nunito-Variable.ttf \; 2>/dev/null || true && \
|
||||
# Clean up\
|
||||
cd /tmp && rm -rf fonts roboto *.zip && \
|
||||
fc-cache -f -v
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
|
||||
|
||||
Reference in New Issue
Block a user