Skip to content

Commit dd83131

Browse files
committed
Fix: fixed suggested changes
1 parent 1f5f9c9 commit dd83131

4 files changed

Lines changed: 21 additions & 15 deletions

File tree

.github/workflows/docker-release.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,23 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Checkout repo
12-
uses: actions/checkout@v3
12+
uses: actions/checkout@v4
1313

14-
- name: Set up docker Buildx
15-
uses: docker/setup-buildx-action@v2
14+
- name: Set up Docker Buildx
15+
uses: docker/setup-buildx-action@v3
1616

17-
- name: Docker-hub account login
18-
uses: docker/login-action@v2
17+
- name: Docker Hub account login
18+
uses: docker/login-action@v3
1919
with:
20-
username: ${{ secrets.DOCKER_USERNAME }}
21-
password: ${{ secrets.DOCKER_PASSWORD }}
20+
username: ${{ secrets.DOCKERHUB_USERNAME }}
21+
password: ${{ secrets.DOCKERHUB_TOKEN }}
2222

2323
- name: Extract release tag
2424
id: meta
2525
run: echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
2626

2727
- name: Build and push Docker image
28-
uses: docker/build-push-action@v3
28+
uses: docker/build-push-action@v5
2929
with:
3030
context: .
3131
file: Dockerfile
@@ -34,5 +34,5 @@ jobs:
3434
${{ secrets.DOCKER_USERNAME }}/nexumdb:latest
3535
${{ secrets.DOCKER_USERNAME }}/nexumdb:${{ steps.meta.outputs.version }}
3636
${{ secrets.DOCKER_USERNAME }}/nexumdb:${{ github.sha }}
37-
cache-from: type=registry,ref=${{ secrets.DOCKER_USERNAME }}/nexumdb:buildcache
38-
cache-to: type=registry,ref=${{ secrets.DOCKER_USERNAME }}/nexumdb:buildcache,mode=max
37+
cache-from: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/nexumdb:buildcache
38+
cache-to: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/nexumdb:buildcache,mode=max

Dockerfile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ RUN apt-get update && apt-get install -y \
1414
&& rm -rf /var/lib/apt/lists/*
1515

1616
COPY Cargo.toml Cargo.lock ./
17-
COPY . .
17+
COPY src ./src
1818

1919
ENV PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1
2020

21-
RUN cargo build --release --manifest-path ./Cargo.toml
21+
RUN cargo build --release
2222

2323
# STAGE 2
2424
FROM debian:bookworm-slim
2525

2626
RUN apt-get update && apt-get install -y \
2727
python3 \
2828
python3-venv \
29-
libpython3.11 \
29+
python3-dev \
3030
libssl-dev \
3131
ca-certificates \
3232
&& rm -rf /var/lib/apt/lists/*
@@ -41,7 +41,12 @@ RUN python3 -m venv .venv && \
4141
. .venv/bin/activate && \
4242
pip install --no-cache-dir -r nexum_ai/requirements.txt
4343

44+
RUN useradd --system --create-home --home-dir /app --shell /bin/bash nexumuser && \
45+
chown -R nexumuser:nexumuser /app
46+
4447
ENV PATH="/app/.venv/bin:$PATH"
4548
ENV VIRTUAL_ENV="/app/.venv"
4649

50+
USER nexumuser
51+
4752
CMD ["nexum"]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ $ docker compose down
8181

8282
### Logs
8383

84-
```badh
84+
```bash
8585
$ docker-compose logs
8686
```
8787

docker-compose.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ services:
1010
- RUST_LOG=info
1111
volumes:
1212
- ./data:/app/data
13-
- ./config.toml:/app/config.toml
1413
networks:
1514
- app-network
15+
ports:
16+
- "8080:8080"
1617

1718
networks:
1819
app-network:

0 commit comments

Comments
 (0)