moq-rs/server/Dockerfile

37 lines
719 B
Docker
Raw Normal View History

2022-07-07 04:28:16 +00:00
# build image #
FROM golang:1.18 AS build
WORKDIR /src
# Don't use the Go proxy because it's blocked on my laptop (lul)
ENV GOPRIVATE=*
# Copy over the files.
COPY . .
# Run the unit tests.
RUN go test -race ./...
# Run go vet
RUN go vet ./...
# Make sure go fmt was run.
# If this fails, you should configure your editor to run `gofmt` on save.
RUN test -z $(go fmt ./...)
# Install the binary.
RUN go install -v ./warp-server
# Final image
FROM ubuntu:22.04
# Install root certs for HTTPS
RUN apt-get update && \
apt-get install -y --no-install-recommends ca-certificates
# Copy the binary from the build image
COPY --from=build /go/bin /usr/local/bin
# Copy over our pre-encoded media.
COPY media /media