generated from VLADIMIR/template
add docker
This commit is contained in:
parent
71b20274ff
commit
1a1530e5b5
1
.vscode/settings.json
vendored
1
.vscode/settings.json
vendored
@ -5,6 +5,7 @@
|
||||
"Номера",
|
||||
"Событие",
|
||||
"событиями",
|
||||
"GOARCH",
|
||||
"gocarina",
|
||||
"gocsv"
|
||||
]
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
FROM alpine:latest
|
||||
RUN apk add --no-cache ca-certificates
|
||||
COPY bin/pinned_message /usr/local/bin/pinned_message
|
||||
COPY bin/pinned_message_linux_arm64 /usr/local/bin/pinned_message
|
||||
RUN chmod +x /usr/local/bin/pinned_message
|
||||
CMD ["/usr/local/bin/pinned_message"]
|
||||
|
||||
10
Makefile
10
Makefile
@ -12,6 +12,12 @@ generate:
|
||||
run:
|
||||
go run ./cmd/pinned_message/main.go
|
||||
|
||||
build:
|
||||
go build -o bin/pinned_message cmd/pinned_message/main.go
|
||||
build-macos:
|
||||
rm -rf bin
|
||||
CGO_ENABLED=1 GOOS=darwin GOARCH=arm64 go build -o bin/pinned_message_macos_arm64 cmd/pinned_message/main.go
|
||||
|
||||
build-linux:
|
||||
rm -rf bin
|
||||
docker run --rm -v "$$PWD":/app -w /app golang:1.22-alpine sh -c \
|
||||
"apk add --no-cache gcc musl-dev && \
|
||||
CGO_ENABLED=1 GOOS=linux GOARCH=arm64 go build -o bin/pinned_message_linux_arm64 cmd/pinned_message/main.go"
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@ -6,6 +6,5 @@ services:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
ports:
|
||||
- "8080:8080"
|
||||
# environment:
|
||||
# - ENV_VAR_NAME=env_var_value
|
||||
- "8210:8210"
|
||||
- "8220:8220"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user