Ajay Yadav commited on
Commit
a03f48b
·
1 Parent(s): 9e41e1e

Deploy da-policyengine dev environment

Browse files
Files changed (2) hide show
  1. Dockerfile +22 -38
  2. README.md +12 -38
Dockerfile CHANGED
@@ -1,38 +1,22 @@
1
- FROM openjdk:21-jdk-slim
2
-
3
- WORKDIR /code
4
-
5
- # Install required packages
6
- RUN apt-get update && apt-get install -y \
7
- curl \
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
-
30
- # Expose port
31
- EXPOSE 8080
32
-
33
- # Health check
34
- HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
35
- CMD curl -f http://localhost:8080/actuator/health || exit 1
36
-
37
- # Run application
38
- CMD ["java", "-jar", "build/libs/da-policyengine.jar"]
 
1
+ FROM openjdk:21-jdk-slim
2
+
3
+ WORKDIR /code
4
+
5
+ RUN apt-get update && apt-get install -y curl wget && rm -rf /var/lib/apt/lists/*
6
+
7
+ RUN useradd -m -u 1000 user
8
+ USER user
9
+
10
+ ENV HOME=/home/user PATH=/home/user/.local/bin:$PATH
11
+
12
+ WORKDIR $HOME/app
13
+
14
+ COPY --chown=user . $HOME/app
15
+
16
+ RUN if [ -f "gradlew" ]; then chmod +x gradlew && ./gradlew build -x test; fi
17
+
18
+ EXPOSE 8080
19
+
20
+ HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 CMD curl -f http://localhost:8080/actuator/health || exit 1
21
+
22
+ CMD ["java", "-jar", "build/libs/da-policyengine.jar"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
README.md CHANGED
@@ -1,38 +1,12 @@
1
- ---
2
- title: da-policyengine dev
3
- emoji: 🔧
4
- colorFrom: blue
5
- colorTo: green
6
- sdk: docker
7
- app_port: 8080
8
- ---
9
-
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: Tue 06/17/2025 13:38:54.73
 
1
+ ---
2
+ title: da-policyengine dev
3
+ emoji: 🔧
4
+ colorFrom: blue
5
+ colorTo: green
6
+ sdk: docker
7
+ app_port: 8080
8
+ ---
9
+
10
+ # da-policyengine - dev Environment
11
+
12
+ This is the da-policyengine microservice deployed in the dev environment.