From 17b0b86f6d41eb3d3b9fa3df8548cb66daaa39fc Mon Sep 17 00:00:00 2001 From: Tobias Reisinger Date: Sat, 17 Aug 2019 11:04:15 +0200 Subject: [PATCH] fix: docker files --- Dockerfile | 11 ++++------- Dockerfile.drogon | 5 +---- build.sh | 6 ++++-- docker-compose.yml | 21 +++++++++++++++++++++ 4 files changed, 30 insertions(+), 13 deletions(-) create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile index d5077a0..4fdc622 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,19 +1,16 @@ -FROM drogonframework/drogon AS installer +FROM drogonframework/drogon-arm AS installer ENV CORE_ROOT=$IROOT/core -WORKDIR $IROOT - COPY . $CORE_ROOT WORKDIR $CORE_ROOT RUN ./build.sh -FROM drogonframework/drogon +FROM drogonframework/drogon-arm -COPY --from=installer /srv/core /srv/core +COPY --from=installer /bin/core /bin/core EXPOSE 5000 - -ENTRYPOINT ["/srv/core"] +ENTRYPOINT ["core"] diff --git a/Dockerfile.drogon b/Dockerfile.drogon index 77ec13b..4b842e9 100644 --- a/Dockerfile.drogon +++ b/Dockerfile.drogon @@ -21,7 +21,4 @@ ENV DROGON_ROOT=$IROOT/drogon WORKDIR $IROOT ADD https://api.github.com/repos/an-tao/drogon/git/refs/heads/master version.json -RUN git clone https://github.com/an-tao/drogon - -WORKDIR $DROGON_ROOT -RUN ./build.sh +RUN git clone https://github.com/an-tao/drogon && cd drogon && ./build.sh diff --git a/build.sh b/build.sh index 936aed8..d0dc97a 100755 --- a/build.sh +++ b/build.sh @@ -29,5 +29,7 @@ if [ "$?" != "0" ]; then exit -1 fi -cp core /srv/ -cp config.json /srv/ +cp core /bin/ + +mkdir /srv/core +cp config.json /srv/core diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..3f1d89e --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,21 @@ +version: '3.2' +volumes: + v-core-data: +services: + drogon-arm: + image: drogonframework/drogon-arm + build: + context: . + dockerfile: Dockerfile.drogon + core: + image: registry.gitlab.com/emgauwa/core + build: + context: . + dockerfile: Dockerfile + restart: always + ports: + - "80:5000" + volumes: + - type: volume + source: v-core-data + target: /srv/core