Skip to content

Commit d1b9f1a

Browse files
committed
Fix: suggested but coherant changes
1 parent dd83131 commit d1b9f1a

3 files changed

Lines changed: 28 additions & 15 deletions

File tree

.github/workflows/docker-release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ jobs:
3131
file: Dockerfile
3232
push: true
3333
tags: |
34-
${{ secrets.DOCKER_USERNAME }}/nexumdb:latest
35-
${{ secrets.DOCKER_USERNAME }}/nexumdb:${{ steps.meta.outputs.version }}
36-
${{ secrets.DOCKER_USERNAME }}/nexumdb:${{ github.sha }}
34+
${{ secrets.DOCKERHUB_USERNAME }}/nexumdb:latest
35+
${{ secrets.DOCKERHUB_USERNAME }}/nexumdb:${{ steps.meta.outputs.version }}
36+
${{ secrets.DOCKERHUB_USERNAME }}/nexumdb:${{ github.sha }}
3737
cache-from: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/nexumdb:buildcache
3838
cache-to: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/nexumdb:buildcache,mode=max

Dockerfile

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# STAGE 1
1+
##################################################
2+
#################### STAGE 1 #####################
3+
##################################################
24
FROM rust:1-bookworm AS builder
35

46
WORKDIR /app
@@ -14,13 +16,25 @@ RUN apt-get update && apt-get install -y \
1416
&& rm -rf /var/lib/apt/lists/*
1517

1618
COPY Cargo.toml Cargo.lock ./
17-
COPY src ./src
19+
COPY nexum_cli/Cargo.toml ./nexum_cli/
20+
COPY nexum_core/Cargo.toml ./nexum_core/
21+
COPY tests/Cargo.toml ./tests/
22+
23+
RUN mkdir -p src && echo "fn main() {}" > src/main.rs
1824

1925
ENV PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1
2026

21-
RUN cargo build --release
27+
RUN cargo build --release
28+
29+
COPY nexum_core ./nexum_core
30+
COPY nexum_cli ./nexum_cli
31+
COPY tests ./tests
2232

23-
# STAGE 2
33+
RUN touch src/main.rs && cargo build --release
34+
35+
##################################################
36+
#################### STAGE 2 #####################
37+
##################################################
2438
FROM debian:bookworm-slim
2539

2640
RUN apt-get update && apt-get install -y \
@@ -34,19 +48,18 @@ RUN apt-get update && apt-get install -y \
3448
WORKDIR /app
3549

3650
COPY --from=builder /app/target/release/nexum /usr/local/bin/nexum
37-
3851
COPY nexum_ai ./nexum_ai
3952

53+
RUN useradd --system --create-home --home-dir /app --shell /bin/bash nexumuser && \
54+
chown -R nexumuser:nexumuser /app
55+
56+
USER nexumuser
57+
4058
RUN python3 -m venv .venv && \
4159
. .venv/bin/activate && \
4260
pip install --no-cache-dir -r nexum_ai/requirements.txt
4361

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

50-
USER nexumuser
51-
5265
CMD ["nexum"]

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,13 @@ $ docker compose build
7070
### Run the application
7171

7272
```bash
73-
$ docker compose up
73+
$ docker compose up
7474
```
7575

7676
### Stop the application
7777

7878
```bash
79-
$ docker compose down
79+
$ docker compose down
8080
```
8181

8282
### Logs

0 commit comments

Comments
 (0)