@devkong/cli-nx 0.0.67-alpha.18 → 0.0.67-alpha.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devkong/cli-nx",
3
- "version": "0.0.67-alpha.18",
3
+ "version": "0.0.67-alpha.19",
4
4
  "type": "commonjs",
5
5
  "main": "./src/index.js",
6
6
  "typings": "./src/index.d.ts",
@@ -1,3 +1,5 @@
1
+ # syntax=docker/dockerfile:1
2
+
1
3
  # ==============================================
2
4
  # Stage 1: Build native executable
3
5
  # ==============================================
@@ -20,13 +22,15 @@ USER quarkus
20
22
  WORKDIR /code
21
23
 
22
24
  # Make Gradle wrapper executable and download dependencies
23
- RUN chmod +x gradlew && \
25
+ RUN --mount=type=cache,target=/home/quarkus/.gradle,uid=1001,gid=1001 \
26
+ chmod +x gradlew && \
24
27
  ./gradlew dependencies --no-daemon --stacktrace
25
28
 
26
29
 
27
30
  # Build native executable
28
31
  COPY --chown=quarkus:quarkus src /code/src
29
- RUN ./gradlew build \
32
+ RUN --mount=type=cache,target=/home/quarkus/.gradle,uid=1001,gid=1001 \
33
+ ./gradlew build \
30
34
  -Dquarkus.package.main-class=io.kong.sdk.function.template.QuarkusApp \
31
35
  -Dquarkus.native.enabled=true \
32
36
  -Dquarkus.profile=prod \
@@ -36,7 +40,7 @@ RUN ./gradlew build \
36
40
  --stacktrace
37
41
 
38
42
  # ==============================================
39
- # Stage 2: Create minimal runtime image
43
+ # Stage 2: Create runtime image
40
44
  # ==============================================
41
45
  FROM quay.io/quarkus/quarkus-micro-image:2.0
42
46
 
@@ -1,13 +1,30 @@
1
1
  # syntax=docker/dockerfile:1
2
2
 
3
- FROM --platform=linux/amd64 python:3.13.1-slim-bullseye
3
+ # ==============================================
4
+ # Stage 1: Create runtime image
5
+ # ==============================================
6
+ FROM --platform=linux/amd64 python:3.13.1-slim-bookworm
4
7
 
5
- ENV APP_DIR=/deployments/app
8
+ ENV APP_DIR=/deployments/app \
9
+ PYTHONUNBUFFERED=1 \
10
+ PYTHONDONTWRITEBYTECODE=1
6
11
 
7
- COPY ./requirements-lock.txt $APP_DIR/requirements-lock.txt
8
- RUN pip install -r $APP_DIR/requirements-lock.txt
9
-
10
- COPY ./src $APP_DIR/src
11
12
  WORKDIR $APP_DIR
12
13
 
14
+ # Install dependencies first (for better caching)
15
+ COPY --chown=1001:root ./requirements-lock.txt ./requirements-lock.txt
16
+ RUN --mount=type=cache,target=/root/.cache/pip \
17
+ pip install --upgrade pip && \
18
+ pip install -r requirements-lock.txt
19
+
20
+ # Copy application sources
21
+ COPY --chown=1001:root ./src ./src
22
+
23
+ # Create a non-root user and switch to it for security
24
+ RUN useradd --uid 1001 --gid root --create-home app \
25
+ && chown 1001:root $APP_DIR \
26
+ && chmod "g+rwX" $APP_DIR
27
+
28
+ USER 1001
29
+
13
30
  CMD ["python", "./src/main.py"]