File tree Expand file tree Collapse file tree 5 files changed +71
-1
lines changed Expand file tree Collapse file tree 5 files changed +71
-1
lines changed Original file line number Diff line number Diff line change
1
+ FROM golang:1.23.0
2
+
3
+ WORKDIR /usr/src/app
4
+
5
+ COPY . .
6
+
7
+ RUN make
8
+
9
+ EXPOSE 3002
10
+
11
+ CMD ["./bin/assets-server" ]
Original file line number Diff line number Diff line change
1
+ SHELL := bash
2
+ .PHONY : build clean download run linux windows mac default
3
+ .DEFAULT_GOAL := default
4
+
5
+ clean :
6
+ @echo " Cleaning up..."
7
+ @rm -rf build
8
+
9
+ download :
10
+ @echo " Downloading dependencies..."
11
+ @go get
12
+
13
+ run :
14
+ @echo " Running..."
15
+ @go run main.go
16
+
17
+ linux : download
18
+ @echo " Building for Linux..."
19
+ @GOOS=linux GOARCH=amd64 go build -o bin/assets-server -ldflags " -s -w" main.go
20
+ @GOOS=linux GOARCH=arm go build -o bin/assets-server-arm -ldflags " -s -w" main.go
21
+ @GOOS=linux GOARCH=arm64 go build -o bin/assets-server-arm64 -ldflags " -s -w" main.go
22
+ @GOOS=linux GOARCH=386 go build -o bin/assets-server-386 -ldflags " -s -w" main.go
23
+
24
+ windows : download
25
+ @echo " Building for Windows..."
26
+ @GOOS=windows GOARCH=amd64 go build -o bin/assets-server.exe -ldflags " -s -w" main.go
27
+ @GOOS=windows GOARCH=386 go build -o bin/assets-server-386.exe -ldflags " -s -w" main.go
28
+
29
+ mac : download
30
+ @echo " Building for Mac..."
31
+ @GOOS=darwin GOARCH=amd64 go build -o bin/assets-server-mac -ldflags " -s -w" main.go
32
+ @GOOS=darwin GOARCH=arm64 go build -o bin/assets-server-mac-arm64 -ldflags " -s -w" main.go
33
+
34
+ default : clean download
35
+ @echo " Building for current OS..."
36
+ @go build -o bin/assets-server -ldflags " -s -w" main.go
37
+
38
+ format :
39
+ @echo " Formatting..."
40
+ @go fmt
41
+
42
+ all : clean download linux windows mac
Original file line number Diff line number Diff line change 14
14
- I recommend using Docker for this so you don't have to build the server files!
15
15
- A docker-compose.yml & Dockerfile are provided.
16
16
- You can either use the prebuilt docker image (docker-compose.yml)
17
- - Or clone the repository and build yourself with docker (not recommended as the repo is huge )
17
+ - Or clone the repository and build yourself with docker (docker-compose.build.yml )
18
18
19
19
### Using in your frontend
20
20
This is super easy!
Original file line number Diff line number Diff line change
1
+ version : " 3"
2
+
3
+ services :
4
+ assets-server :
5
+ image : assets-server:latest
6
+ build :
7
+ context : .
8
+ dockerfile : Dockerfile
9
+ ports :
10
+ - 3002:3002
Original file line number Diff line number Diff line change
1
+ version : " 3"
2
+
3
+ services :
4
+ assets-server :
5
+ image : ghcr.io/ruby-network/assets-server:latest
6
+ ports :
7
+ - 3002:3002
You can’t perform that action at this time.
0 commit comments