-
-
Notifications
You must be signed in to change notification settings - Fork 4
refactor: use alpine for web app #50
base: main
Are you sure you want to change the base?
Changes from 1 commit
517e5e8
b289442
1950257
1c86da2
e002aa9
53985e1
7fd47c3
989cd9a
f26abf7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,29 +1,17 @@ | ||||||||||||||||||||||
| FROM rust:slim AS typ2docx | ||||||||||||||||||||||
| RUN apt update && apt install -y --no-install-recommends \ | ||||||||||||||||||||||
| curl pkg-config libssl-dev | ||||||||||||||||||||||
| RUN curl -LsSf https://astral.sh/uv/install.sh | sh | ||||||||||||||||||||||
| FROM rust:alpine AS typ2docx | ||||||||||||||||||||||
| RUN apk add pkgconfig openssl-dev uv gcompat | ||||||||||||||||||||||
|
||||||||||||||||||||||
| RUN apk add pkgconfig openssl-dev uv gcompat | |
| RUN apk add pkgconf openssl-dev uv gcompat |
Copilot
AI
Dec 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Installing uv via apk requires adding the community or testing repository, as it's not available in the main Alpine repository. Consider either adding the repository explicitly (e.g., RUN apk add --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing uv) or reverting to the curl installation method from the original version to ensure the build succeeds reliably.
| RUN apk add pkgconfig openssl-dev uv gcompat | |
| RUN apk add pkgconfig openssl-dev gcompat && \ | |
| apk add --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing uv |
Copilot
AI
Dec 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using alpine:edge provides the latest rolling release packages but can introduce instability and breaking changes. Consider using a stable Alpine version (e.g., alpine:3.20) with an explicit typst version for better reproducibility and reliability in production environments.
| FROM alpine:edge AS typst | |
| RUN apk add typst | |
| FROM alpine:3.20 AS typst | |
| RUN apk add --no-cache ca-certificates wget tar | |
| # Install specific typst version (e.g., v0.10.0) | |
| ENV TYPST_VERSION=0.10.0 | |
| RUN wget -O typst.tar.xz https://github.com/typst/typst/releases/download/v${TYPST_VERSION}/typst-x86_64-unknown-linux-musl.tar.xz \ | |
| && tar -xf typst.tar.xz \ | |
| && mv typst-x86_64-unknown-linux-musl/typst /usr/bin/typst \ | |
| && rm -rf typst-x86_64-unknown-linux-musl typst.tar.xz |
Copilot
AI
Dec 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing the --no-cache flag for apk add commands. Adding this flag (e.g., RUN apk add --no-cache ...) prevents caching the package index and reduces the final image size, which is a best practice for Alpine-based Docker images.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
gcompatpackage provides GNU libc compatibility for musl-based Alpine, which is needed for Python packages likesaxonche(listed in pyproject.toml) that have glibc dependencies. However,gcompatmay not fully support all glibc features. Consider testing thoroughly to ensure all Python dependencies (especiallysaxonche,pdfservices-sdk, andpdf2docx) work correctly with musl/gcompat, or document any known limitations.