aboutsummaryrefslogtreecommitdiffstats
path: root/Dockerfile
diff options
context:
space:
mode:
authorterminaldweller <devi@terminaldweller.com>2023-10-09 15:31:04 +0000
committerterminaldweller <devi@terminaldweller.com>2023-10-09 15:31:04 +0000
commit0007b69fdbbcf463eeb538c02dc191ccd6f62df9 (patch)
tree87f1c31a0730b995abfc49291906cb9e6c8711d7 /Dockerfile
parentInitial commit (diff)
downloadsms-webhook-0007b69fdbbcf463eeb538c02dc191ccd6f62df9.tar.gz
sms-webhook-0007b69fdbbcf463eeb538c02dc191ccd6f62df9.zip
onedev
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile20
1 files changed, 20 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..e014703
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,20 @@
+FROM alpine:3.18 as builder
+RUN apk update && apk upgrade && \
+ apk add go git
+RUN git clone https://github.com/terminaldweller/sms-webhook
+WORKDIR /sms-webhook
+COPY go.sum go.mod /sms-webhook/
+COPY *.go /sms-webhook/
+RUN go mod download
+ENV CGO_ENABLED=0
+RUN go build
+
+FROM alpine:3.18 as certbuilder
+RUN apk add openssl
+WORKDIR /certs
+RUN openssl req -nodes -new -x509 -subj="/C=US/ST=Denial/L=springfield/O=Dis/CN=sms-webhook" -keyout server.key -out server.cert
+
+FROM alpine:3.18
+COPY --from=certbuilder /certs /certs
+COPY --from=builder /sms-webhook/sms-webhook /sms-webhook/
+ENTRYPOINT ["/sms-webhook/sms-webhook"]