forked from zedeus/nitter
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
10a9dc7
commit 80796bb
Showing
5 changed files
with
51 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
FROM nimlang/nim:2.0.0-alpine-regular as nim | ||
LABEL maintainer="setenforce@protonmail.com" | ||
|
||
RUN apk --no-cache add libsass-dev pcre | ||
|
||
WORKDIR /src/nitter | ||
|
||
COPY nitter.nimble . | ||
RUN nimble install -y --depsOnly | ||
|
||
COPY . . | ||
RUN nimble build -d:danger -d:lto -d:strip \ | ||
&& nimble scss \ | ||
&& nimble md | ||
|
||
COPY entrypoint.sh . | ||
|
||
FROM alpine:latest | ||
WORKDIR /src/ | ||
RUN apk --no-cache add pcre ca-certificates | ||
COPY --from=nim /src/nitter/entrypoint.sh ./ | ||
COPY --from=nim /src/nitter/nitter ./ | ||
COPY --from=nim /src/nitter/nitter.example.conf ./nitter.conf | ||
COPY --from=nim /src/nitter/public ./public | ||
EXPOSE 8080 | ||
RUN adduser -h /src/ -D -s /bin/sh nitter | ||
USER nitter | ||
ENTRYPOINT ["/src/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
# Read the version from package.json | ||
VERSION=1.0.6-fly | ||
IMAGE=kristobalus/nitter | ||
echo "building image $IMAGE using buildx..." | ||
|
||
docker buildx create --use --name buildx_instance --driver docker-container --bootstrap | ||
docker buildx build -f ./Dockerfile.fly \ | ||
--progress=plain \ | ||
--build-arg VERSION="$VERSION" \ | ||
--label "build-tag=build-artifact" \ | ||
--platform linux/amd64 \ | ||
-t $IMAGE:$VERSION \ | ||
--push . || { echo "failed to build docker image"; exit 1; } | ||
|
||
# commented out to keep cached layers | ||
# docker buildx rm buildx_instance | ||
docker tag $IMAGE:$VERSION $IMAGE:latest-fly | ||
docker push $IMAGE:latest-fly | ||
docker image prune -f --filter label=build-tag=build-artifact |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters