diff --git a/.dockerignore b/.dockerignore index 2fe2e01..23fc44b 100644 --- a/.dockerignore +++ b/.dockerignore @@ -4,4 +4,6 @@ docker-compose.yaml README.md LICENSE logs/*.log -account/*.json \ No newline at end of file +account/*.json +.idea +venv \ No newline at end of file diff --git a/.github/workflows/docker_build.yml b/.github/workflows/docker_build.yml index 362b557..3c3ac33 100644 --- a/.github/workflows/docker_build.yml +++ b/.github/workflows/docker_build.yml @@ -30,7 +30,7 @@ jobs: tags: | type=sha,format=short - - name: Build and push + - name: Build and push (Dockerfile) uses: docker/build-push-action@v5 with: context: . @@ -43,5 +43,18 @@ jobs: build-args: GITHUB_ACTIONS=true platforms: linux/amd64,linux/arm64 + - name: Build and push (Dockerfile.armhf) + uses: docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile.armhf + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max + build-args: GITHUB_ACTIONS=true + platforms: linux/arm/v7 + - name: Image digest run: echo ${{ steps.meta.outputs.digest }} diff --git a/Dockerfile.armhf b/Dockerfile.armhf new file mode 100644 index 0000000..bbab64d --- /dev/null +++ b/Dockerfile.armhf @@ -0,0 +1,25 @@ +# Use an official Python runtime as a parent image +FROM python:3.11-slim + +WORKDIR /app + +# Install Python dependencies +COPY requirements.txt ./ + +# Install Python, pip, necessary build dependencies,in one layer +RUN apt-get update && \ + apt-get install -y libffi-dev libssl-dev build-essential && \ + printf "[global]\nextra-index-url=https://www.piwheels.org/simple\n" > /etc/pip.conf && \ + pip3 install --no-cache-dir -r requirements.txt && \ + apt-get autoremove -y && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +# Copy the rest of the code +COPY . . +RUN chmod +x ./scripts/*.sh + +# Set environment variables +ENV RUN_IN_DOCKER=true + +CMD ["/bin/sh", "./scripts/run.sh"] \ No newline at end of file