Skip to content

Commit ae2d892

Browse files
author
Dave Altena
committed
fix: update dockerfile and workflow
1 parent 6afb81a commit ae2d892

File tree

4 files changed

+75
-82
lines changed

4 files changed

+75
-82
lines changed

.github/workflows/ci.yaml

Lines changed: 0 additions & 45 deletions
This file was deleted.

.github/workflows/release.yaml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
name: Release
3+
4+
on:
5+
pull_request:
6+
push:
7+
branches: ["main"]
8+
release:
9+
types: ["published"]
10+
11+
jobs:
12+
build-image:
13+
if: ${{ github.event.pull_request.head.repo.full_name == github.repository || github.event_name != 'pull_request' }}
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
packages: write
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Docker meta
23+
id: meta
24+
uses: docker/metadata-action@v5
25+
with:
26+
images: |
27+
ghcr.io/${{ github.repository }}
28+
tags: |
29+
type=semver,pattern={{version}},prefix=v
30+
type=semver,pattern={{major}}.{{minor}},prefix=v
31+
type=semver,pattern={{major}},prefix=v
32+
type=ref,event=branch
33+
type=ref,event=pr
34+
flavor: |
35+
latest=auto
36+
37+
- name: Set up QEMU
38+
uses: docker/setup-qemu-action@v3
39+
40+
- name: Set up Docker Buildx
41+
uses: docker/setup-buildx-action@v3
42+
43+
- name: Login to GitHub Container Registry
44+
uses: docker/login-action@v3
45+
with:
46+
registry: ghcr.io
47+
username: ${{ github.actor }}
48+
password: ${{ secrets.GITHUB_TOKEN }}
49+
50+
- name: Build and Push
51+
uses: docker/build-push-action@v6
52+
with:
53+
context: .
54+
file: ./Dockerfile
55+
platforms: linux/amd64 # TODO: arm64 builds take ~4 hours to complete
56+
push: true
57+
tags: ${{ steps.meta.outputs.tags }}
58+
labels: ${{ steps.meta.outputs.labels }}

Dockerfile

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,28 @@
1-
FROM lukemathwalker/cargo-chef:latest-rust-1.84.1-slim-bookworm AS chef
1+
FROM docker.io/lukemathwalker/cargo-chef:latest-rust-1.83.0-alpine3.21 AS chef
22
WORKDIR /app
33

44
FROM chef AS planner
55
COPY . .
66
RUN cargo chef prepare --recipe-path recipe.json
77

88
FROM chef AS builder
9-
10-
# Ensure working C compile setup (not installed by default in arm64 images)
11-
RUN apt update && apt install build-essential -y
12-
9+
RUN apk add --no-cache build-base
1310
COPY --from=planner /app/recipe.json recipe.json
1411
RUN cargo chef cook --release --recipe-path recipe.json
15-
1612
COPY . .
1713
RUN cargo build --release --bin atuin-server-sqlite-unofficial
1814

19-
FROM debian:bookworm-20250113-slim AS runtime
20-
21-
RUN useradd -c 'atuin user' atuin && mkdir /config && chown atuin:atuin /config
22-
# Install ca-certificates for webhooks to work
23-
RUN apt update && apt install ca-certificates sqlite3 -y && rm -rf /var/lib/apt/lists/*
24-
WORKDIR /app
25-
26-
USER atuin
27-
28-
ENV TZ=Etc/UTC
29-
ENV RUST_LOG=atuin::api=info
30-
ENV ATUIN_CONFIG_DIR=/config
31-
15+
FROM docker.io/library/alpine:3.21
16+
ENV RUST_LOG=atuin::api=info \
17+
TZ=Etc/UTC \
18+
ATUIN_HOST=0.0.0.0 \
19+
ATUIN_PORT=8888 \
20+
ATUIN_CONFIG_DIR=/config \
21+
ATUIN_DB_URI=sqlite:///config/atuin.db
22+
RUN apk add --no-cache ca-certificates catatonit sqlite-libs tzdata
23+
USER nobody:nogroup
24+
WORKDIR /config
25+
VOLUME ["/config"]
3226
COPY --from=builder /app/target/release/atuin-server-sqlite-unofficial /usr/local/bin
33-
ENTRYPOINT ["/usr/local/bin/atuin-server-sqlite-unofficial"]
27+
ENTRYPOINT ["/usr/bin/catatonit", "--", "/usr/local/bin/atuin-server-sqlite-unofficial"]
28+
CMD ["server", "start"]

README.md

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,3 @@
1-
# atuin sqlite
1+
# Atuin server sqlite
22

3-
atuin server but uses sqlite backend.
4-
5-
## Support ⚠️
6-
7-
While I am a maintainer of `atuin`, This is not an officially supported project and it mostly exists because people kept asking for it and
8-
it wasn't too hard to put here.
9-
10-
## Usage
11-
12-
```sh
13-
cargo install --release --git https://github.com/conradludgate/atuin-server-sqlite
14-
export ATUIN_DB_URI=sqlite://path/to/sqlite/file.db
15-
atuin-server-sqlite-unofficial
16-
```
17-
18-
See the atuin self hosting docs for more info on settings.
3+
Also a project to learn multi-arch container builds.

0 commit comments

Comments
 (0)