File tree 4 files changed +56
-0
lines changed
4 files changed +56
-0
lines changed Original file line number Diff line number Diff line change
1
+ .git /
2
+ .github
3
+ assets /
4
+ bin /
5
+ test /
6
+ tmp /
7
+ LICENSE
8
+ README.md
9
+ Makefile
Original file line number Diff line number Diff line change
1
+ FROM golang:1.22-alpine3.20 AS builder
2
+
3
+ RUN mkdir /app && mkdir -p /usr/local/src/smolgit
4
+ WORKDIR /usr/local/src/smolgit
5
+
6
+ ADD ./go.mod ./go.sum ./
7
+ RUN go mod download
8
+ ADD . ./
9
+
10
+ RUN go build -v -o /build/smolgit
11
+
12
+ FROM alpine/git:2.45.2 AS runner
13
+
14
+ COPY --from=builder /build/smolgit /usr/bin/smolgit
15
+
16
+ EXPOSE 3080
17
+ EXPOSE 3081
18
+ ENTRYPOINT ["/usr/bin/smolgit" , "--config" , "/etc/smolgit/config.yaml" ]
Original file line number Diff line number Diff line change @@ -18,6 +18,9 @@ all: help
18
18
build : # # Build all the binaries and put the output in bin/
19
19
$(GOCMD ) build -ldflags " -X main.version=$( BRANCH) -$( HASH) " -o bin/$(PROJECT_NAME ) .
20
20
21
+ build-docker : # # Build an image
22
+ docker build -t $(PROJECT_NAME ) .
23
+
21
24
# # Clean:
22
25
clean : # # Remove build related file
23
26
@-rm -fr ./bin
@@ -26,6 +29,12 @@ clean: ## Remove build related file
26
29
run : clean build # # Run the smolgit `make run`
27
30
./bin/$(PROJECT_NAME ) $(ARGS )
28
31
32
+ run-docker : # # Run smolgit in the container
33
+ docker run -it -p 3080:3080 -p 3081:3081 -v $(PWD ) /:/etc/smolgit $(PROJECT_NAME )
34
+
35
+ config-docker : # # Generate smolgit config
36
+ docker run -it $(PROJECT_NAME ) config > config.yaml
37
+
29
38
config : # # Generate default config
30
39
./bin/$(PROJECT_NAME ) config > ./config.yaml
31
40
Original file line number Diff line number Diff line change 10
10
- [ Install] ( #install )
11
11
- [ Run] ( #run )
12
12
- [ Config] ( #config )
13
+ - [ Docker] ( #docker )
13
14
- [ Prerequisites] ( #prerequisites )
14
15
- [ Built with] ( #built-with )
15
16
- [ Contribution] ( #contribution )
@@ -112,6 +113,25 @@ Usage of ./smolgit:
112
113
path to config (default "./config.yaml")
113
114
```
114
115
116
+ #### Docker
117
+
118
+ In order to run ` smolgit ` in docker there is the [ ` Dockerfile ` ] ( /Dockerfile ) .
119
+
120
+ 1 . Build image ` make build-docker `
121
+ 1 . Generate ` config.yaml ` file ` make config-docker ` , it'll create ` config.yaml ` in the current directory and mount it for docker.
122
+ 1 . Run ` smolgit ` in docker:
123
+
124
+ ``` shell
125
+ $> make run-docker
126
+ docker run -it -p 3080:3080 -p 3081:3081 -v /path-to-smolgit-project/smolgit/:/etc/smolgit smolgit
127
+ 3:53PM INF set loglevel level=DEBUG
128
+ 3:53PM INF version version=dev
129
+ 3:53PM INF initialize web server addr=:3080
130
+ 3:53PM INF initialize ssh server addr=:3081
131
+ 3:53PM INF start server brand=smolgit address=:3080
132
+ 3:53PM INF starting SSH server addr=:3081
133
+ ```
134
+
115
135
### Prerequisites
116
136
117
137
- git
You can’t perform that action at this time.
0 commit comments