summaryrefslogtreecommitdiffstats
path: root/Dockerfile
blob: 856932140c0b11a52a6f353c5cd3d65d352c995b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
FROM rust:1-alpine AS builder

# Set the working directory
WORKDIR /usr/src/app

# Copy the local project files (since Dockerfile and project are in the same directory)
COPY . .

# Build and install the local Rust program
RUN cargo install --path . --locked
RUN cargo install --locked argc

FROM alpine:3.21

RUN apk add --no-cache \
    bash ca-certificates curl git jq \
    ripgrep fd \
    unzip zip xz \
    less nano vim tmux \
    openssh-client-default \
    python3 py3-pip py3-virtualenv \
    nodejs npm \
    build-base pkgconf cmake \
    lynx tree \
    pandoc-cli \
    texlive texmf-dist-latexextra texmf-dist-langgerman \
    poppler-utils \
    tzdata

RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y

# Copy your newly built binary (replace  with your actual crate name)
COPY --from=builder /usr/local/cargo/bin/aichat /usr/local/bin/aichat
COPY --from=builder /usr/local/cargo/bin/argc   /usr/local/bin/argc

RUN addgroup -g 1000 dev \
 && adduser -u 1000 -G dev -s /bin/bash -D dev \
 && addgroup dev wheel \
 && mkdir -p /work /projects /home/dev/.config \
 && chown -R dev:dev /work /projects /home/dev

USER dev

ENV AICHAT_FUNCTIONS_DIR=/opt/llm-functions

WORKDIR /work
CMD ["bash"]