初始化项目结构
This commit is contained in:
15
manifest/config/config.yaml
Normal file
15
manifest/config/config.yaml
Normal file
@ -0,0 +1,15 @@
|
||||
# https://goframe.org/docs/web/server-config-file-template
|
||||
server:
|
||||
address: ":8000"
|
||||
openapiPath: "/api.json"
|
||||
swaggerPath: "/swagger"
|
||||
|
||||
# https://goframe.org/docs/core/glog-config
|
||||
logger:
|
||||
level : "all"
|
||||
stdout: true
|
||||
|
||||
# https://goframe.org/docs/core/gdb-config-file
|
||||
database:
|
||||
default:
|
||||
link: "mysql:root:12345678@tcp(127.0.0.1:3306)/test"
|
||||
21
manifest/deploy/kustomize/base/deployment.yaml
Normal file
21
manifest/deploy/kustomize/base/deployment.yaml
Normal file
@ -0,0 +1,21 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: template-single
|
||||
labels:
|
||||
app: template-single
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: template-single
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: template-single
|
||||
spec:
|
||||
containers:
|
||||
- name : main
|
||||
image: template-single
|
||||
imagePullPolicy: Always
|
||||
|
||||
8
manifest/deploy/kustomize/base/kustomization.yaml
Normal file
8
manifest/deploy/kustomize/base/kustomization.yaml
Normal file
@ -0,0 +1,8 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
- deployment.yaml
|
||||
- service.yaml
|
||||
|
||||
|
||||
|
||||
12
manifest/deploy/kustomize/base/service.yaml
Normal file
12
manifest/deploy/kustomize/base/service.yaml
Normal file
@ -0,0 +1,12 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: template-single
|
||||
spec:
|
||||
ports:
|
||||
- port: 80
|
||||
protocol: TCP
|
||||
targetPort: 8000
|
||||
selector:
|
||||
app: template-single
|
||||
|
||||
14
manifest/deploy/kustomize/overlays/develop/configmap.yaml
Normal file
14
manifest/deploy/kustomize/overlays/develop/configmap.yaml
Normal file
@ -0,0 +1,14 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: template-single-configmap
|
||||
data:
|
||||
config.yaml: |
|
||||
server:
|
||||
address: ":8000"
|
||||
openapiPath: "/api.json"
|
||||
swaggerPath: "/swagger"
|
||||
|
||||
logger:
|
||||
level : "all"
|
||||
stdout: true
|
||||
10
manifest/deploy/kustomize/overlays/develop/deployment.yaml
Normal file
10
manifest/deploy/kustomize/overlays/develop/deployment.yaml
Normal file
@ -0,0 +1,10 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: template-single
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name : main
|
||||
image: template-single:develop
|
||||
@ -0,0 +1,14 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
|
||||
resources:
|
||||
- ../../base
|
||||
- configmap.yaml
|
||||
|
||||
patchesStrategicMerge:
|
||||
- deployment.yaml
|
||||
|
||||
namespace: default
|
||||
|
||||
|
||||
|
||||
16
manifest/docker/Dockerfile
Normal file
16
manifest/docker/Dockerfile
Normal file
@ -0,0 +1,16 @@
|
||||
FROM loads/alpine:3.8
|
||||
|
||||
###############################################################################
|
||||
# INSTALLATION
|
||||
###############################################################################
|
||||
|
||||
ENV WORKDIR /app
|
||||
ADD resource $WORKDIR/
|
||||
ADD ./temp/linux_amd64/main $WORKDIR/main
|
||||
RUN chmod +x $WORKDIR/main
|
||||
|
||||
###############################################################################
|
||||
# START
|
||||
###############################################################################
|
||||
WORKDIR $WORKDIR
|
||||
CMD ./main
|
||||
8
manifest/docker/docker.sh
Normal file
8
manifest/docker/docker.sh
Normal file
@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
# This shell is executed before docker build.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
0
manifest/i18n/.gitkeep
Normal file
0
manifest/i18n/.gitkeep
Normal file
0
manifest/protobuf/.keep-if-necessary
Normal file
0
manifest/protobuf/.keep-if-necessary
Normal file
Reference in New Issue
Block a user