FROM alpine:latest AS build WORKDIR /build RUN apk update && \ apk add --no-cache gcc musl-dev postgresql-dev COPY service.c . RUN gcc -o service service.c -lpq FROM postgres:alpine COPY script.sh . COPY --from=build /build/service . ENTRYPOINT ["./script.sh"]