Mise en place du projet
This commit is contained in:
36
misc/containers/super-graph/Dockerfile
Normal file
36
misc/containers/super-graph/Dockerfile
Normal file
@ -0,0 +1,36 @@
|
||||
FROM alpine:edge AS build
|
||||
|
||||
ARG HTTP_PROXY=
|
||||
ARG HTTPS_PROXY=
|
||||
ARG http_proxy=
|
||||
ARG https_proxy=
|
||||
|
||||
ARG SUPERGRAPH_VERSION=v0.14.17
|
||||
ARG WAITFORIT_VERSION=v2.4.1
|
||||
|
||||
RUN apk add --no-cache go make git curl bash ca-certificates
|
||||
|
||||
RUN git clone https://github.com/dosco/super-graph \
|
||||
&& export PATH="$PATH:/root/go/bin" \
|
||||
&& export CGO_ENABLED=0 \
|
||||
&& cd super-graph \
|
||||
&& git checkout ${SUPERGRAPH_VERSION} \
|
||||
&& make SHELL='bash -x' build
|
||||
|
||||
RUN curl -sL \
|
||||
-o /usr/local/bin/waitforit \
|
||||
https://github.com/maxcnunes/waitforit/releases/download/${WAITFORIT_VERSION}/waitforit-linux_amd64
|
||||
|
||||
FROM alpine:3.11
|
||||
|
||||
COPY --from=build /super-graph/super-graph /usr/local/bin/super-graph
|
||||
COPY --from=build /usr/local/bin/waitforit /usr/local/bin/waitforit
|
||||
|
||||
RUN chmod +x /usr/local/bin/waitforit
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint
|
||||
RUN chmod +x /usr/local/bin/docker-entrypoint
|
||||
|
||||
CMD ["/usr/local/bin/docker-entrypoint"]
|
13
misc/containers/super-graph/docker-entrypoint.sh
Normal file
13
misc/containers/super-graph/docker-entrypoint.sh
Normal file
@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -eo pipefail
|
||||
|
||||
if [ ! -f /container-lifecycle/first_run ]; then
|
||||
waitforit -debug -host $SG_DATABASE_HOST -port 5432
|
||||
super-graph db:migrate up
|
||||
super-graph db:seed
|
||||
mkdir /container-lifecycle
|
||||
touch /container-lifecycle/first_run
|
||||
fi
|
||||
|
||||
super-graph serv
|
Reference in New Issue
Block a user