Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +4 -2
Dockerfile
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
# Use a specific version of the node image as a base
|
| 2 |
FROM node:16-alpine
|
| 3 |
|
|
|
|
| 4 |
RUN apk add --no-cache openjdk11 python3 py3-pip g++
|
| 5 |
|
| 6 |
# Set working directory
|
|
@@ -23,6 +24,7 @@ EXPOSE 7860
|
|
| 23 |
# Set user to non-root
|
| 24 |
USER node
|
| 25 |
|
| 26 |
-
#
|
| 27 |
-
CMD ["
|
|
|
|
| 28 |
|
|
|
|
| 1 |
# Use a specific version of the node image as a base
|
| 2 |
FROM node:16-alpine
|
| 3 |
|
| 4 |
+
# Install necessary dependencies including JDK, Python, pip, and g++
|
| 5 |
RUN apk add --no-cache openjdk11 python3 py3-pip g++
|
| 6 |
|
| 7 |
# Set working directory
|
|
|
|
| 24 |
# Set user to non-root
|
| 25 |
USER node
|
| 26 |
|
| 27 |
+
# Compile and run Java code
|
| 28 |
+
CMD ["sh", "-c", "javac -d /code/temp /code/temp/*.java && java -cp /code/temp Main"]
|
| 29 |
+
|
| 30 |
|