added building docker container
This commit is contained in:
1 parent
0f777d3e68
commit
42a57bf284
5 files changed
+71
No files matched your search
@@ -1,3 +1,4 @@
|
|||||||
scm
|
scm
|
||||||
go.sum
|
go.sum
|
||||||
certs
|
certs
|
||||||
|
data
|
||||||
+21
@@ -0,0 +1,21 @@
|
|||||||
|
FROM golang:1.24.5-alpine AS build-stage
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN apk update && \
|
||||||
|
apk upgrade && \
|
||||||
|
apk add binutils && \
|
||||||
|
go mod tidy && \
|
||||||
|
go build && \
|
||||||
|
strip scm
|
||||||
|
FROM alpine:latest AS build-release-stage
|
||||||
|
|
||||||
|
WORKDIR /data
|
||||||
|
|
||||||
|
COPY --from=build-stage /app/scm /scm
|
||||||
|
RUN mkdir -p /certs
|
||||||
|
COPY scm.conf.docker /data/scm.conf
|
||||||
|
|
||||||
|
ENTRYPOINT [ "/scm" ]
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
services:
|
||||||
|
scm:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
container_name: scm_server
|
||||||
|
ports:
|
||||||
|
- "8777:8777"
|
||||||
|
volumes:
|
||||||
|
- ./data:/data
|
||||||
|
- ./certs:/certs
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
ENABLE_TLS=false
|
||||||
|
|
||||||
|
CERTS_PATH=/certs
|
||||||
|
|
||||||
|
SERVER_ADDRESS=0.0.0.0
|
||||||
|
SERVER_PORT=8777
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
#--- import colors and init-funcs ---
|
||||||
|
. /usr/lib/init/colors.sh
|
||||||
|
. /usr/lib/init/init-funcs.sh
|
||||||
|
#------------------------------------
|
||||||
|
|
||||||
|
start() {
|
||||||
|
notify "Starting scm"
|
||||||
|
/usr/bin/scm &
|
||||||
|
echo $(pgrep scm) > /var/run/scm.pid
|
||||||
|
check $? "start scm"
|
||||||
|
return $?
|
||||||
|
}
|
||||||
|
|
||||||
|
stop() {
|
||||||
|
notify "Stopping scm"
|
||||||
|
kill $(cat /var/run/scm.pid)
|
||||||
|
check $? "stop scm"
|
||||||
|
rm /var/run/scm.pid &> /dev/null
|
||||||
|
return $?
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start|stop|restart|reload|help)
|
||||||
|
"$1"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
help
|
||||||
|
return 1
|
||||||
|
esac
|
||||||
|
return $?
|
||||||
Reference in new issue
Block a user