mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-16 09:51:59 +03:00
c7a2320456
* Listens for SIGTERM as the termination signal * Stops accepting new connections once the signal is received * Waits for all connections to be drained, before shutting down * Forcefully kills all pending connections after 30 seconds Currently this does not send a close message to websocket clients, I'd like to submit that change as a separate pull request, but at least this solve my biggest concern which is not getting confirmation for mutations while restarting the server.
27 lines
914 B
Docker
27 lines
914 B
Docker
ARG stack_resolver
|
|
ARG packager_version
|
|
|
|
# Stage 1: build the application
|
|
FROM fpco/stack-build:${stack_resolver} as builder
|
|
ARG stack_flags=""
|
|
ARG build_flags=""
|
|
ARG project="graphql-engine"
|
|
RUN mkdir /build
|
|
COPY . /build/
|
|
WORKDIR /build
|
|
RUN stack --system-ghc ${stack_flags} build ${build_flags}
|
|
RUN cp $(stack --system-ghc path --dist-dir)/build/${project}/${project} /build
|
|
|
|
# Stage 2: package the app into a busybox rootfs, strip, compress etc.
|
|
FROM hasura/graphql-engine-packager:${packager_version} as packager
|
|
ARG project="graphql-engine"
|
|
RUN mkdir -p /packaging/build/rootfs
|
|
COPY --from=builder /build/${project} /root/
|
|
RUN /build.sh ${project} | tar -xC /packaging/build/rootfs
|
|
RUN strip --strip-unneeded /packaging/build/rootfs/bin/${project}
|
|
RUN upx /packaging/build/rootfs/bin/${project}
|
|
|
|
# Stage 3: copy the rootfs into a scratch container
|
|
FROM scratch
|
|
COPY --from=packager /packaging/build/rootfs /
|