mirror of
https://github.com/Ravinou/borgwarehouse
synced 2024-06-28 18:30:12 +02:00
ci: build for arm/v7 explicitly + action to build develop
This commit is contained in:
parent
ac715e9173
commit
15e7859e66
29
.github/workflows/docker-image-develop.yml
vendored
Normal file
29
.github/workflows/docker-image-develop.yml
vendored
Normal file
|
@ -0,0 +1,29 @@
|
|||
name: Build and Push Docker Image for Develop Branch
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'develop'
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
||||
tags: borgwarehouse/borgwarehouse:develop
|
53
.github/workflows/docker-image-latest.yml
vendored
53
.github/workflows/docker-image-latest.yml
vendored
|
@ -1,34 +1,29 @@
|
|||
name: Build and Push Docker Image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
-
|
||||
name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
-
|
||||
name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
platforms: linux/amd64,linux/arm64,linux/arm
|
||||
tags: borgwarehouse/borgwarehouse:latest
|
||||
docker:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
||||
tags: borgwarehouse/borgwarehouse:latest
|
||||
|
|
60
.github/workflows/docker-image-release.yml
vendored
60
.github/workflows/docker-image-release.yml
vendored
|
@ -1,38 +1,32 @@
|
|||
name: Build and Push Docker Image on Release
|
||||
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- published
|
||||
release:
|
||||
types:
|
||||
- published
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
-
|
||||
name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
-
|
||||
name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
-
|
||||
name: Get Release Tag
|
||||
id: get_release_tag
|
||||
run: echo "::set-output name=TAG::${{ github.event.release.tag_name }}"
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
platforms: linux/amd64,linux/arm64
|
||||
tags: borgwarehouse/borgwarehouse:${{ steps.get_release_tag.outputs.TAG }}
|
||||
docker:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
- name: Get Release Tag
|
||||
id: get_release_tag
|
||||
run: echo "::set-output name=TAG::${{ github.event.release.tag_name }}"
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
||||
tags: borgwarehouse/borgwarehouse:${{ steps.get_release_tag.outputs.TAG }}
|
||||
|
|
2
.github/workflows/docker-image-test.yml
vendored
2
.github/workflows/docker-image-test.yml
vendored
|
@ -18,4 +18,4 @@ jobs:
|
|||
uses: docker/setup-buildx-action@v3
|
||||
- name: Build Docker Container
|
||||
run: |
|
||||
docker buildx build --platform linux/amd64,linux/arm64 -t borgwarehouse:pr-${{ github.event.pull_request.number }} .
|
||||
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t borgwarehouse:pr-${{ github.event.pull_request.number }} .
|
||||
|
|
12
Dockerfile
12
Dockerfile
|
@ -27,11 +27,10 @@ FROM base AS runner
|
|||
ENV NODE_ENV production
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
curl jq jc borgbackup openssh-server sudo && \
|
||||
supervisor \
|
||||
curl jq jc borgbackup openssh-server sudo cron && \
|
||||
apt-get clean && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN echo "borgwarehouse ALL=(ALL) NOPASSWD: /usr/sbin/service ssh restart" >> /etc/sudoers
|
||||
|
||||
RUN groupadd borgwarehouse
|
||||
|
||||
RUN useradd -m -g borgwarehouse borgwarehouse
|
||||
|
@ -40,16 +39,15 @@ RUN cp /etc/ssh/sshd_config /etc/ssh/moduli /home/borgwarehouse/
|
|||
|
||||
WORKDIR /home/borgwarehouse/app
|
||||
|
||||
COPY --from=builder --chown=borgwarehouse:borgwarehouse /app/docker-bw-init.sh /app/LICENSE ./
|
||||
COPY --from=builder --chown=borgwarehouse:borgwarehouse /app/docker/docker-bw-init.sh /app/LICENSE ./
|
||||
COPY --from=builder --chown=borgwarehouse:borgwarehouse /app/helpers/shells ./helpers/shells
|
||||
COPY --from=builder --chown=borgwarehouse:borgwarehouse /app/.next/standalone ./
|
||||
COPY --from=builder --chown=borgwarehouse:borgwarehouse /app/public ./public
|
||||
COPY --from=builder --chown=borgwarehouse:borgwarehouse /app/.next/static ./.next/static
|
||||
COPY --from=builder --chown=borgwarehouse:borgwarehouse /app/docker/supervisord.conf ./
|
||||
|
||||
USER borgwarehouse
|
||||
|
||||
EXPOSE 3000 22
|
||||
|
||||
ENTRYPOINT ["./docker-bw-init.sh"]
|
||||
|
||||
CMD ["node", "server.js"]
|
||||
ENTRYPOINT ["./docker-bw-init.sh"]
|
|
@ -7,7 +7,8 @@ services:
|
|||
# context: .
|
||||
# dockerfile: Dockerfile
|
||||
image: borgwarehouse/borgwarehouse
|
||||
# UID:GID must match the user and group ID of the host folders and must be > 1000
|
||||
# UID:GID must match the user and group ID of the host folders and must be > 1000.
|
||||
# If you want to use a different user, you must rebuild the image yourself.
|
||||
user: '1001:1001'
|
||||
ports:
|
||||
- '3000:3000'
|
||||
|
@ -25,6 +26,8 @@ services:
|
|||
- <host-folder>/ssh:/home/borgwarehouse/.ssh
|
||||
- <host-folder>/ssh_host:/etc/ssh
|
||||
- <host-folder>/repos:/home/borgwarehouse/repos
|
||||
- <host-folder>/logs:/home/borgwarehouse/logs
|
||||
- <host-folder>/tmp:/home/borgwarehouse/tmp
|
||||
# Apprise is used to send notifications, it's optional. http://apprise:8000 is the URL to use in BorgWarehouse.
|
||||
apprise:
|
||||
container_name: apprise
|
||||
|
|
|
@ -78,6 +78,4 @@ create_authorized_keys_file
|
|||
check_repos_directory
|
||||
get_SSH_fingerprints
|
||||
|
||||
sudo service ssh restart
|
||||
|
||||
exec "$@"
|
||||
exec supervisord -c /home/borgwarehouse/app/supervisord.conf
|
21
docker/supervisord.conf
Normal file
21
docker/supervisord.conf
Normal file
|
@ -0,0 +1,21 @@
|
|||
[supervisord]
|
||||
nodaemon=true
|
||||
logfile=/home/borgwarehouse/logs/supervisord.log
|
||||
loglevel=error
|
||||
pidfile=/home/borgwarehouse/tmp/supervisord.pid
|
||||
logfile_maxbytes=10MB
|
||||
logfile_backups=5
|
||||
|
||||
[program:sshd]
|
||||
command=/usr/sbin/sshd -D -e -o PidFile=/home/borgwarehouse/tmp/sshd.pid -o SyslogFacility=AUTH -o LogLevel=INFO -o PasswordAuthentication=no -o ChallengeResponseAuthentication=no -o UsePAM=no -o PermitRootLogin=no
|
||||
stdout_logfile=/home/borgwarehouse/logs/sshd.log
|
||||
stdout_logfile_maxbytes=10MB
|
||||
stdout_logfile_backups=5
|
||||
redirect_stderr=true
|
||||
|
||||
[program:borgwarehouse]
|
||||
command=/usr/local/bin/node server.js
|
||||
stdout_logfile=/home/borgwarehouse/logs/borgwarehouse.log
|
||||
stdout_logfile_maxbytes=10MB
|
||||
stdout_logfile_backups=5
|
||||
redirect_stderr=true
|
Loading…
Reference in a new issue