Skip to content

Commit

Permalink
feat add chi
Browse files Browse the repository at this point in the history
  • Loading branch information
cbluebird committed Sep 26, 2024
1 parent 2c01d91 commit 1f897b2
Show file tree
Hide file tree
Showing 10 changed files with 59 additions and 3 deletions.
12 changes: 12 additions & 0 deletions Framework/chi/update_cn_dockerfile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

DOCKERFILE=$1
echo "DOCKERFILE: $DOCKERFILE"
TMP_DOCKERFILE="${DOCKERFILE}tmp"
cp "$DOCKERFILE" "$TMP_DOCKERFILE"

sed -i '$i\
COPY /OS/debian-ssh/debian.sources /etc/apt/sources.list.d/debian.sources' "$TMP_DOCKERFILE"

sed -i '$i\
RUN echo "export GOPROXY=https://goproxy.cn,direct" >> /home/sealos/.bashrc && echo "export GOPROXY=https://goproxy.cn,direct" >> /root/.bashrc' "$TMP_DOCKERFILE"
17 changes: 17 additions & 0 deletions Framework/chi/v5.1.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM ghcr.io/labring-actions/devbox/go-1.22.5:715122

RUN cd /home/sealos/project && \
rm -rf ./*

COPY /Framework/chi/v5.1.0/project /home/sealos/project

RUN chown -R sealos:sealos /home/sealos/project && \
chmod -R u+rw /home/sealos/project && \
chmod -R +x /home/sealos/project/entrypoint.sh

USER sealos
RUN cd /home/sealos/project && \
go mod tidy && \
go build -o main main.go

RUN mkdir /home/sealos/.sealos
1 change: 1 addition & 0 deletions Framework/chi/v5.1.0/project/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
./main
5 changes: 5 additions & 0 deletions Framework/chi/v5.1.0/project/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module main

go 1.22.5

require github.com/go-chi/chi/v5 v5.1.0
2 changes: 2 additions & 0 deletions Framework/chi/v5.1.0/project/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github.com/go-chi/chi/v5 v5.1.0 h1:acVI1TYaD+hhedDJ3r54HyA6sExp3HfXq7QWEEY/xMw=
github.com/go-chi/chi/v5 v5.1.0/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
17 changes: 17 additions & 0 deletions Framework/chi/v5.1.0/project/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package main

import (
"net/http"

"github.com/go-chi/chi/v5"
"github.com/go-chi/chi/v5/middleware"
)

func main() {
r := chi.NewRouter()
r.Use(middleware.Logger)
r.Get("/", func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("welcome"))
})
http.ListenAndServe(":8080", r)
}
3 changes: 2 additions & 1 deletion configs/name.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ gin=gin
next.js=next.js
spring-boot=Spring Boot
vue=vue
echo=8080
echo=echo
chi=chi
react=react
1 change: 1 addition & 0 deletions configs/port.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ next.js=3000
spring-boot=8080
vue=3000
echo=8080
chi=8080
react=3000
2 changes: 1 addition & 1 deletion yaml/cn/Framework/echo/v4.12.0/v4.12.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ kind: RuntimeClass
metadata:
name: echo
spec:
title: "8080"
title: "echo"
kind: Framework
description: echo
2 changes: 1 addition & 1 deletion yaml/en/Framework/echo/v4.12.0/v4.12.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ kind: RuntimeClass
metadata:
name: echo
spec:
title: "8080"
title: "echo"
kind: Framework
description: echo

0 comments on commit 1f897b2

Please sign in to comment.