Created
February 13, 2024 14:42
-
-
Save zpeters/08d325dc3c435f31ab8f0b5ea63260e8 to your computer and use it in GitHub Desktop.
Docker Container with litestream
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
FROM docker.io/golang:1.18 as builder | |
WORKDIR /app | |
COPY go.mod go.sum ./ | |
RUN go mod download | |
COPY . . | |
RUN go build -o main . | |
FROM docker.io/debian:bookworm-slim | |
RUN apt update; apt -y upgrade; apt install -y wget; wget "https://github.com/benbjohnson/litestream/releases/download/v0.3.13/litestream-v0.3.13-linux-amd64.deb"; dpkg -i "litestream-v0.3.13-linux-amd64.deb" | |
WORKDIR /root/ | |
COPY --from=builder /app/main . | |
COPY ./web/ web/ | |
COPY ./assets/ assets/ | |
COPY ./etc/litestream.yml . | |
EXPOSE 8080 | |
ENV FIBER_PROD=true | |
# run restore first in case db exists, then run main process | |
COPY ./start.sh . | |
CMD ["./start.sh"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See: