Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +10 -4
Dockerfile
CHANGED
|
@@ -19,11 +19,11 @@ RUN go build -o main main.go
|
|
| 19 |
# Debug step: list the contents of the /app directory
|
| 20 |
RUN ls -al /app
|
| 21 |
|
| 22 |
-
# Use a
|
| 23 |
-
FROM
|
| 24 |
|
| 25 |
# Install ca-certificates to make HTTPS requests
|
| 26 |
-
RUN
|
| 27 |
|
| 28 |
# Set the Current Working Directory inside the container
|
| 29 |
WORKDIR /root/
|
|
@@ -37,8 +37,14 @@ RUN chmod +x /root/main
|
|
| 37 |
# Debug step: list the contents of the /root directory again to confirm permissions
|
| 38 |
RUN ls -al /root
|
| 39 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
# Expose port 8080 to the outside world
|
| 41 |
EXPOSE 8080
|
| 42 |
|
| 43 |
# Command to run the executable
|
| 44 |
-
CMD
|
|
|
|
| 19 |
# Debug step: list the contents of the /app directory
|
| 20 |
RUN ls -al /app
|
| 21 |
|
| 22 |
+
# Use a debian base image to reduce the final image size
|
| 23 |
+
FROM debian:latest
|
| 24 |
|
| 25 |
# Install ca-certificates to make HTTPS requests
|
| 26 |
+
RUN apt-get update && apt-get install -y ca-certificates
|
| 27 |
|
| 28 |
# Set the Current Working Directory inside the container
|
| 29 |
WORKDIR /root/
|
|
|
|
| 37 |
# Debug step: list the contents of the /root directory again to confirm permissions
|
| 38 |
RUN ls -al /root
|
| 39 |
|
| 40 |
+
# Debug step: show file information
|
| 41 |
+
RUN file /root/main
|
| 42 |
+
|
| 43 |
+
# Ensure we are running as the root user
|
| 44 |
+
USER root
|
| 45 |
+
|
| 46 |
# Expose port 8080 to the outside world
|
| 47 |
EXPOSE 8080
|
| 48 |
|
| 49 |
# Command to run the executable
|
| 50 |
+
CMD ["/root/main"]
|