Skip to content

Commit

Permalink
soy
Browse files Browse the repository at this point in the history
  • Loading branch information
seychelles111 authored Jul 22, 2023
1 parent 1c3acb3 commit 529e9e2
Showing 1 changed file with 0 additions and 55 deletions.
55 changes: 0 additions & 55 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,61 +27,6 @@ run response=$(curl -s "https://api.github.com/repos/libreddit/libreddit/release



# RUN gh auth login --hostname github.com
# RUN gh release download --repo libreddit/libreddit --pattern 'libreddit'

####################################################################################################
## Final image
####################################################################################################
FROM alpine:latest

# Import ca-certificates from builder
COPY --from=builder /usr/share/ca-certificates /usr/share/ca-certificates
COPY --from=builder /etc/ssl/certs /etc/ssl/certs

# Copy our build
COPY --from=builder /libreddit/libreddit /usr/local/bin/libreddit

# Use an unprivileged user.
RUN adduser --home /nonexistent --no-create-home --disabled-password libreddit
USER libreddit

# Tell Docker to expose port 8080
EXPOSE 8080

# Run a healthcheck every minute to make sure Libreddit is functional
HEALTHCHECK --interval=1m --timeout=3s CMD wget --spider --q http://localhost:8080/settings || exit 1

CMD ["libreddit"]
####################################################################################################
## Builder
####################################################################################################
FROM rust:alpine AS builder

# USER root

RUN apk add --no-cache musl-dev curl
# apk add github-cli

WORKDIR /libreddit

COPY . .


# Make the script executable
# RUN chmod +x extract_download_url.sh


run response=$(curl -s "https://api.github.com/repos/libreddit/libreddit/releases/latest") && \
download_urls=$(echo "$response" | grep -o -E "https://github.com/libreddit/libreddit/releases/download/[^/]+/libreddit") && \
selected_url=$(echo "$download_urls" | head -n 1) && \
echo "Download URL: $selected_url" && \
curl -L "$selected_url" -o /libreddit/libreddit && \
chmod +x /libreddit/libreddit
##########################################



# RUN gh auth login --hostname github.com
# RUN gh release download --repo libreddit/libreddit --pattern 'libreddit'

Expand Down

0 comments on commit 529e9e2

Please sign in to comment.