updated
هذا الالتزام موجود في:
13
test-projects/go-web-test/.gy.json
Normal file
13
test-projects/go-web-test/.gy.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"app": "go-web-test",
|
||||
"project": "go-web-test",
|
||||
"_app_id": "7f5a4300-a098-4433-8b8c-200f29da51f0",
|
||||
"_project_id": "7a31cf5a-82f1-4762-8c1f-905c3c64ebc9",
|
||||
"port": 8000,
|
||||
"publicAccess": {
|
||||
"enabled": true,
|
||||
"domain": "go-web-test-246327147195.hosted.ghaymah.systems"
|
||||
},
|
||||
"resourceTier": "t1",
|
||||
"_detected": "dockerfile"
|
||||
}
|
||||
15
test-projects/go-web-test/Dockerfile
Normal file
15
test-projects/go-web-test/Dockerfile
Normal file
@@ -0,0 +1,15 @@
|
||||
# 🔷 Auto-generated Dockerfile for Go
|
||||
# Ghaymah detected:
|
||||
FROM golang:1.22-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
COPY go.mod go.sum* ./
|
||||
RUN go mod download 2>/dev/null || true
|
||||
COPY . .
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -o /app/bin/app .
|
||||
|
||||
FROM alpine:3.19
|
||||
RUN apk --no-cache add ca-certificates
|
||||
COPY --from=builder /app/bin/app /app
|
||||
EXPOSE 8080
|
||||
CMD ["/app"]
|
||||
3
test-projects/go-web-test/go.mod
Normal file
3
test-projects/go-web-test/go.mod
Normal file
@@ -0,0 +1,3 @@
|
||||
module go-web-test
|
||||
|
||||
go 1.22
|
||||
21
test-projects/go-web-test/main.go
Normal file
21
test-projects/go-web-test/main.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"os"
|
||||
)
|
||||
|
||||
func main() {
|
||||
port := os.Getenv("PORT")
|
||||
if port == "" {
|
||||
port = "8000"
|
||||
}
|
||||
|
||||
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||
fmt.Fprintln(w, "Hello from Go!")
|
||||
})
|
||||
|
||||
fmt.Println("Server listening on :" + port)
|
||||
http.ListenAndServe(":"+port, nil)
|
||||
}
|
||||
المرجع في مشكلة جديدة
حظر مستخدم