Skip to content

Commit

Permalink
Switch to alpine builds
Browse files Browse the repository at this point in the history
  • Loading branch information
wafflespeanut committed Apr 2, 2024
1 parent a5d3355 commit ceda19f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
3 changes: 0 additions & 3 deletions scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ docker run --name static \
-e AWS_REGION=${AWS_REGION} \
-e AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} \
-e AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} \
-e TWILIO_ACCOUNT=${TWILIO_ACCOUNT} \
-e TWILIO_TOKEN=${TWILIO_TOKEN} \
-e TWILIO_SENDER=${TWILIO_SENDER} \
-d wafflespeanut/static-server

echo 'Launching ace game!'
Expand Down
5 changes: 3 additions & 2 deletions server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
FROM rust:alpine
RUN apk add --update musl-dev openssl-dev
RUN apk add --update musl-dev openssl-dev openssl-libs-static g++
COPY . /home/rust/src
WORKDIR /home/rust/src
ENV RUSTFLAGS="-C link-args=-Wl,-Bstatic -C link-args=-lc"
RUN cargo build --release

FROM alpine
Expand All @@ -10,7 +11,7 @@ RUN apk --update upgrade && \
apk add --update inotify-tools && \
rm -rf /var/cache/apk/*

COPY --from=0 /home/rust/src/target/x86_64-unknown-linux-musl/release/server /server
COPY --from=0 /home/rust/src/target/release/server /server

ENV ADDRESS 0.0.0.0:8000
RUN chmod +x /server
Expand Down
6 changes: 3 additions & 3 deletions server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ This is my personal server which serves stuff behind an Nginx proxy for [my webs

In addition to serving static files, it supports:

- Some caching based on mtime and etags.
- Serving private paths i.e., autogenerates public links for private paths and rotates them over desired intervals.
- Sends SMS (through Twilio or AWS SNS) whenever private paths are accessed (over some configured interval).
- Some caching based on mtime and etags
- Serving private paths (autogenerates public links for private paths and rotates them over intervals)
- Sends SMS (through AWS SNS) whenever private paths are accessed

0 comments on commit ceda19f

Please sign in to comment.