From 57e18a112101a18e5f7598cd732421f48342c225 Mon Sep 17 00:00:00 2001 From: Alberto Xamin Date: Sat, 26 Jun 2021 11:25:19 +0200 Subject: [PATCH] separate builds --- .github/workflows/dev-image.yml | 12 +++++++++++- Dockerfile | 2 +- Dockerfile-armv7 | 11 +++++++++++ 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 Dockerfile-armv7 diff --git a/.github/workflows/dev-image.yml b/.github/workflows/dev-image.yml index 79edcf7..e7b5dd3 100644 --- a/.github/workflows/dev-image.yml +++ b/.github/workflows/dev-image.yml @@ -28,10 +28,20 @@ jobs: docker buildx build \ --cache-from "type=local,src=/tmp/.buildx-cache" \ --cache-to "type=local,dest=/tmp/.buildx-cache" \ - --platform linux/amd64,linux/arm/v7,linux/arm64 \ + --platform linux/amd64,linux/arm64 \ --output "type=image,push=false" \ --tag albertoxamin/bang:dev \ --file ./Dockerfile ./ + - + name: Docker Buildx (build) + run: | + docker buildx build \ + --cache-from "type=local,src=/tmp/.buildx-cache" \ + --cache-to "type=local,dest=/tmp/.buildx-cache" \ + --platform linux/arm/v7 \ + --output "type=image,push=false" \ + --tag albertoxamin/bang:dev \ + --file ./Dockerfile-armv7 ./ - name: Login to DockerHub uses: docker/login-action@v1 diff --git a/Dockerfile b/Dockerfile index 06a1600..954c892 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM node:lts-alpine as builder COPY ./frontend . RUN npm install RUN npm run build -FROM python:3.7.10-stretch +FROM python:3.7.10-slim-stretch COPY --from=builder ./dist /dist/ COPY ./backend /dist/ WORKDIR /dist diff --git a/Dockerfile-armv7 b/Dockerfile-armv7 new file mode 100644 index 0000000..06a1600 --- /dev/null +++ b/Dockerfile-armv7 @@ -0,0 +1,11 @@ +FROM node:lts-alpine as builder +COPY ./frontend . +RUN npm install +RUN npm run build +FROM python:3.7.10-stretch +COPY --from=builder ./dist /dist/ +COPY ./backend /dist/ +WORKDIR /dist +RUN pip install -r requirements.txt +EXPOSE 5001 +ENTRYPOINT ["python", "/dist/__init__.py"]