mirror of
https://github.com/Portabase/agent.git
synced 2026-09-11 14:00:14 +00:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a23571bcb2 | |||
| ab22b44c18 | |||
| fcac5bd0da | |||
| 2b8628899d | |||
| 2e11ba2fd4 | |||
| 7d424a78f1 | |||
| 6089e19412 | |||
| 952c70de61 | |||
| 99c42206c1 | |||
| 09b1869833 | |||
| ddffae0d23 |
@@ -31,23 +31,20 @@ jobs:
|
||||
permissions:
|
||||
packages: write
|
||||
contents: read
|
||||
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up QEMU (multi-arch support)
|
||||
- name: Set up QEMU (enables multi-arch emulation)
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
install: true
|
||||
|
||||
- name: Log in to Docker Hub
|
||||
uses: docker/login-action@v2
|
||||
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
@@ -62,40 +59,14 @@ jobs:
|
||||
fi
|
||||
echo "tags=$TAGS" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Build amd64 image
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: ${{ inputs.dockerfile }}
|
||||
# TODO : fix long build in arm64
|
||||
# platforms: linux/amd64,linux/arm64
|
||||
platforms: linux/amd64
|
||||
push: true
|
||||
tags: ${{ inputs.image_name }}:amd64
|
||||
target: ${{ inputs.target }}
|
||||
cache-from: type=registry,ref=${{ inputs.image_name }}:buildcache-amd64
|
||||
cache-to: type=registry,ref=${{ inputs.image_name }}:buildcache-amd64,mode=max
|
||||
|
||||
- name: Build arm64 image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: ${{ inputs.dockerfile }}
|
||||
platforms: linux/arm64
|
||||
push: true
|
||||
tags: ${{ inputs.image_name }}:arm64
|
||||
target: ${{ inputs.target }}
|
||||
cache-from: type=registry,ref=${{ inputs.image_name }}:buildcache-arm64
|
||||
cache-to: type=registry,ref=${{ inputs.image_name }}:buildcache-arm64,mode=max
|
||||
|
||||
- name: Create and push multi-arch manifest
|
||||
run: |
|
||||
REF_NAME=${GITHUB_REF#refs/tags/}
|
||||
docker manifest create ${{ inputs.image_name }}:$REF_NAME \
|
||||
--amend ${{ inputs.image_name }}:amd64 \
|
||||
--amend ${{ inputs.image_name }}:arm64
|
||||
docker manifest push ${{ inputs.image_name }}:$REF_NAME
|
||||
if [[ "${{ inputs.add_latest }}" == "true" ]]; then
|
||||
docker manifest create ${{ inputs.image_name }}:latest \
|
||||
--amend ${{ inputs.image_name }}:amd64 \
|
||||
--amend ${{ inputs.image_name }}:arm64
|
||||
docker manifest push ${{ inputs.image_name }}:latest
|
||||
fi
|
||||
tags: ${{ steps.set-tags.outputs.tags }}
|
||||
target: ${{ inputs.target }}
|
||||
+1
-1
@@ -22,5 +22,5 @@ keywords:
|
||||
- self-hosted
|
||||
- portabase
|
||||
license: Apache-2.0
|
||||
version: 1.0.3-rc.8
|
||||
version: 1.0.3-rc.16
|
||||
date-released: "2026-01-28"
|
||||
Generated
+1
-1
@@ -1595,7 +1595,7 @@ checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c"
|
||||
|
||||
[[package]]
|
||||
name = "portabase-agent"
|
||||
version = "1.0.3-rc.7"
|
||||
version = "1.0.3-rc.15"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-trait",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "portabase-agent"
|
||||
version = "1.0.3-rc.8"
|
||||
version = "1.0.3-rc.16"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+2
-2
@@ -4,7 +4,7 @@ services:
|
||||
context: .
|
||||
dockerfile: docker/Dockerfile
|
||||
target: dev
|
||||
platform: linux/arm64
|
||||
# platform: linux/arm64
|
||||
container_name: rust-dev
|
||||
volumes:
|
||||
- .:/app
|
||||
@@ -17,7 +17,7 @@ services:
|
||||
APP_ENV: development
|
||||
LOG: debug
|
||||
TZ: "Europe/Paris"
|
||||
EDGE_KEY: "eyJzZXJ2ZXJVcmwiOiJodHRwOi8vbG9jYWxob3N0Ojg4ODciLCJhZ2VudElkIjoiNmExMzc0M2ItYjMwZS00Zjg4LWJjY2EtMmMwZjE2NWVjYjQxIiwicHVibGljS2V5IjoiLS0tLS1CRUdJTiBSU0EgUFVCTElDIEtFWS0tLS0tXG5NSUlCQ2dLQ0FRRUE5TWV4M2pmdnVLdFB5YU1ERnh2Ulp2dmd3YkRJQ2JzQi81Wll5NDNSVVRBaXZRYjJiSDdYXG5qRHBQd1lJeCs4UFBrbHlRbDVMQzV1UWZEaCs4SVd4OG1LZ3FvMXpWMkdiZXdGbEdEWFYxVEdyU1ZEU25aSWR4XG52bWdYc29EeXhVMlJvWUFUMS9YMWxuc2YxenZKdkFMTkhXdEhRdk42SjVDZTFSMmFsendVRGFEVXlJNzRmSldQXG5tNTh0SDMrYklXL0VVTXdjaWNxM0oySWw3Vm9KNkZNUHJQL1ZSOWEvdFF1SU1qa200MXpFY2NscExPa2luRkxuXG54NmVUWkFSZUpya2UrbnRvZ2t4TGEyRWV5a1lUNzB4V3hKNWp5ZExBVnRvNkkyQlVLVVJoTkowTUFaU29NYUtvXG5iMGJRcnY1UzExZWllMnMrT2I3aTYzSFpkVUx0UmV1MVJ3SURBUUFCXG4tLS0tLUVORCBSU0EgUFVCTElDIEtFWS0tLS0tXG4ifQ"
|
||||
EDGE_KEY: "eyJzZXJ2ZXJVcmwiOiJodHRwOi8vbG9jYWxob3N0Ojg4ODciLCJhZ2VudElkIjoiNjc4M2QwY2UtNjY1MS00YzM0LTg4YjYtNDhmMmU5YWQ3NGNhIiwicHVibGljS2V5IjoiLS0tLS1CRUdJTiBSU0EgUFVCTElDIEtFWS0tLS0tXG5NSUlCQ2dLQ0FRRUFybjR5bk9OUUwzMGZITERBTjRuNGN4OTNkOHZSTVBzaVYyY2xSU1lDWkNHYnlqakhURW5mXG52dzQ5V1ltS0w3STJJK1dLa00wOEMvQ0NISVlMOE13WSsyNjNnN1dmcjJsQzdIOTFQOTFTK1ZtcCtuREZxVGM5XG45VEZiNXpwb09yaXNZQ3o4M2VLeTV1Q3ZCWXpMODhicmhXNVBlU0VPN3R4SFZBaEp3aWVMWU1JTjJvdTBzWFFiXG5DQ200T3FjRGJBeCs1WmNZVjBPM2NTMjlvNWxaYlV4ZHdxcHl6bjFCSnRETXErYS9tVjFDekxBeGNMd0llNW1WXG5LalBjM01EQ3NvcGJ5czhqcFQ2eFcvSGd5b0c0MkhnL0g3RDdKK21BYlRKZ2JyVGVLdkdaQ1dzMDZGR0hrK1RFXG5RdExwOUprR1lhenVDVFF4TlIvTUU0ejFlNGFrOGsxNmlRSURBUUFCXG4tLS0tLUVORCBSU0EgUFVCTElDIEtFWS0tLS0tXG4ifQ"
|
||||
#POOLING: 1
|
||||
#DATABASES_CONFIG_FILE: "config.toml"
|
||||
extra_hosts:
|
||||
|
||||
+34
-37
@@ -1,9 +1,7 @@
|
||||
# =========================
|
||||
# Base Rust image
|
||||
# Base image (shared)
|
||||
# =========================
|
||||
FROM rust:1.92 AS base
|
||||
|
||||
ARG TARGETARCH
|
||||
FROM rust:1.92.0 AS base
|
||||
|
||||
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
|
||||
pkg-config \
|
||||
@@ -17,66 +15,64 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
|
||||
zlib1g \
|
||||
curl \
|
||||
mariadb-client \
|
||||
wget \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# =========================
|
||||
# PostgreSQL client binaries (only target arch)
|
||||
# =========================
|
||||
RUN for v in 12 13 14 15 16 17 18; do mkdir -p /usr/lib/postgresql/$v/bin; done
|
||||
COPY assets/tools/$TARGETARCH/postgresql/ /tmp/pg/
|
||||
RUN for v in 12 13 14 15 16 17 18; do \
|
||||
cp -r /tmp/pg/postgresql-$v/bin/* /usr/lib/postgresql/$v/bin/; \
|
||||
done && rm -rf /tmp/pg && chmod +x /usr/lib/postgresql/*/bin/*
|
||||
ARG TARGETARCH
|
||||
|
||||
# =========================
|
||||
# MongoDB client binaries (only target arch)
|
||||
# PostgreSQL client binaries (versions 12-18)
|
||||
# =========================
|
||||
|
||||
RUN for v in 12 13 14 15 16 17 18; do \
|
||||
mkdir -p /usr/lib/postgresql/$v/bin; \
|
||||
done
|
||||
|
||||
COPY assets/tools/amd64/postgresql/ /tmp/pg-x64/
|
||||
COPY assets/tools/arm64/postgresql/ /tmp/pg-arm/
|
||||
|
||||
RUN if [ "$TARGETARCH" = "amd64" ]; then \
|
||||
wget -q https://fastdl.mongodb.org/tools/db/mongodb-database-tools-debian12-x86_64-100.10.0.deb -O /tmp/mongodb-tools.deb; \
|
||||
for v in 12 13 14 15 16 17 18; do \
|
||||
cp -r /tmp/pg-x64/postgresql-$v/bin/* /usr/lib/postgresql/$v/bin/; \
|
||||
done; \
|
||||
elif [ "$TARGETARCH" = "arm64" ]; then \
|
||||
wget -q https://fastdl.mongodb.org/tools/db/mongodb-database-tools-ubuntu2204-arm64-100.10.0.deb -O /tmp/mongodb-tools.deb; \
|
||||
fi && dpkg -i /tmp/mongodb-tools.deb || apt-get install -f -y --no-install-recommends && \
|
||||
rm -f /tmp/mongodb-tools.deb && \
|
||||
mkdir -p /usr/local/mongodb/bin && \
|
||||
ln -sf /usr/bin/mongodump /usr/local/mongodb/bin/mongodump || true && \
|
||||
ln -sf /usr/bin/mongorestore /usr/local/mongodb/bin/mongorestore || true
|
||||
for v in 12 13 14 15 16 17 18; do \
|
||||
cp -r /tmp/pg-arm/postgresql-$v/bin/* /usr/lib/postgresql/$v/bin/; \
|
||||
done; \
|
||||
fi && \
|
||||
rm -rf /tmp/pg-x64 /tmp/pg-arm && \
|
||||
chmod +x /usr/lib/postgresql/*/bin/*
|
||||
|
||||
# =========================
|
||||
# MongoDB client binaries
|
||||
# =========================
|
||||
COPY assets/tools/${TARGETARCH}/mongodb/ /usr/local/mongodb/
|
||||
RUN chmod +x /usr/local/mongodb/bin/*
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# =========================
|
||||
# Development stage
|
||||
# Development image
|
||||
# =========================
|
||||
FROM base AS dev
|
||||
|
||||
RUN cargo install cargo-watch
|
||||
|
||||
# Pre-cache dependencies
|
||||
COPY Cargo.toml Cargo.lock ./
|
||||
RUN mkdir src && echo "fn main() {}" > src/main.rs
|
||||
RUN cargo build
|
||||
RUN rm -rf src
|
||||
|
||||
COPY . .
|
||||
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
CMD ["/entrypoint.sh"]
|
||||
|
||||
# =========================
|
||||
# Builder stage for production
|
||||
# Builder (production)
|
||||
# =========================
|
||||
FROM base AS builder
|
||||
WORKDIR /app
|
||||
|
||||
RUN cargo install cargo-chef
|
||||
|
||||
COPY Cargo.toml Cargo.lock ./
|
||||
RUN mkdir src && echo "fn main() {}" > src/main.rs
|
||||
RUN cargo chef prepare --recipe-path recipe.json
|
||||
RUN cargo chef cook --recipe-path recipe.json --release
|
||||
RUN rm -rf src
|
||||
|
||||
COPY . .
|
||||
RUN cargo build --release
|
||||
@@ -84,7 +80,7 @@ RUN cargo build --release
|
||||
RUN echo "APP_VERSION=$(cargo pkgid | awk -F# '{print $2}')" > /app/version.env
|
||||
|
||||
# =========================
|
||||
# Production runtime
|
||||
# Runtime (production)
|
||||
# =========================
|
||||
FROM ubuntu:24.04 AS prod
|
||||
|
||||
@@ -99,16 +95,17 @@ RUN apt-get update && apt-get install -y \
|
||||
mariadb-client \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=builder /app/target/release/app /usr/local/bin/app
|
||||
COPY --from=builder /app/version.env /app/version.env
|
||||
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
COPY --from=base /usr/lib/postgresql/ /usr/lib/postgresql/
|
||||
COPY --from=base /usr/local/mongodb/bin /usr/local/mongodb/bin
|
||||
COPY --from=base /usr/local/mongodb/bin/ /usr/local/mongodb/bin/
|
||||
|
||||
|
||||
ENV APP_ENV=production
|
||||
|
||||
|
||||
Reference in New Issue
Block a user