Ajay Yadav commited on
Commit
ad0c9c3
·
1 Parent(s): 128b1bc

Deploy da-policyengine dev environment

Browse files
Files changed (2) hide show
  1. Dockerfile +16 -5
  2. README.md +1 -27
Dockerfile CHANGED
@@ -1,6 +1,6 @@
1
  FROM openjdk:21-jdk-slim
2
 
3
- WORKDIR /app
4
 
5
  # Install required packages
6
  RUN apt-get update && apt-get install -y \
@@ -8,11 +8,22 @@ RUN apt-get update && apt-get install -y \
8
  wget \
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
- # Copy application files
12
- COPY . .
 
13
 
14
- # Build application (if build.gradle.kts exists)
15
- RUN if [ -f "build.gradle.kts" ]; then \
 
 
 
 
 
 
 
 
 
 
16
  ./gradlew build -x test; \
17
  fi
18
 
 
1
  FROM openjdk:21-jdk-slim
2
 
3
+ WORKDIR /code
4
 
5
  # Install required packages
6
  RUN apt-get update && apt-get install -y \
 
8
  wget \
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
+ # Create user following HF Spaces best practices
12
+ RUN useradd -m -u 1000 user
13
+ USER user
14
 
15
+ # Set environment variables
16
+ ENV HOME=/home/user \
17
+ PATH=/home/user/.local/bin:$PATH
18
+
19
+ WORKDIR $HOME/app
20
+
21
+ # Copy application files with proper ownership
22
+ COPY --chown=user . $HOME/app
23
+
24
+ # Make gradlew executable and build application
25
+ RUN if [ -f "gradlew" ]; then \
26
+ chmod +x gradlew && \
27
  ./gradlew build -x test; \
28
  fi
29
 
README.md CHANGED
@@ -1,5 +1,5 @@
1
  ---
2
- title: da-policyengine (dev)
3
  emoji: 🔧
4
  colorFrom: blue
5
  colorTo: green
@@ -10,29 +10,3 @@ app_port: 8080
10
  # da-policyengine - dev Environment
11
 
12
  This is the da-policyengine microservice deployed in the dev environment.
13
-
14
- ## Features
15
-
16
- - RESTful API endpoints
17
- - Health monitoring via Actuator
18
- - JWT authentication integration
19
- - PostgreSQL database connectivity
20
-
21
- ## API Documentation
22
-
23
- Once deployed, API documentation will be available at:
24
- - Swagger UI: https://huggingface.co/spaces/dalabsai/da-policyengine-dev/swagger-ui.html
25
- - Health Check: https://huggingface.co/spaces/dalabsai/da-policyengine-dev/actuator/health
26
-
27
- ## Environment
28
-
29
- - **Environment**: dev
30
- - **Port**: 8080
31
- - **Java Version**: 21
32
- - **Framework**: Spring Boot
33
-
34
- ## Deployment
35
-
36
- This service is automatically deployed via the DALab CI/CD pipeline.
37
-
38
- Last updated: 2025-06-17 12:03:24
 
1
  ---
2
+ title: da-policyengine dev
3
  emoji: 🔧
4
  colorFrom: blue
5
  colorTo: green
 
10
  # da-policyengine - dev Environment
11
 
12
  This is the da-policyengine microservice deployed in the dev environment.