2024-03-05 18:50:35 +00:00
|
|
|
FROM golang:1.21-alpine as builder
|
2024-02-28 18:07:22 +00:00
|
|
|
#
|
|
|
|
# Include dist
|
|
|
|
COPY dist/ /root/dist/
|
2020-06-18 16:38:43 +00:00
|
|
|
#
|
|
|
|
# Setup apk
|
2021-09-20 21:57:39 +00:00
|
|
|
RUN apk -U add --no-cache \
|
2024-02-28 18:07:22 +00:00
|
|
|
build-base \
|
|
|
|
git \
|
|
|
|
g++ && \
|
2020-06-18 16:38:43 +00:00
|
|
|
#
|
|
|
|
# Setup go, build dicompot
|
|
|
|
mkdir -p /opt/go && \
|
|
|
|
export GOPATH=/opt/go/ && \
|
|
|
|
cd /opt/go/ && \
|
|
|
|
git clone https://github.com/nsmfoo/dicompot.git && \
|
|
|
|
cd dicompot && \
|
2020-10-27 21:30:33 +00:00
|
|
|
git checkout 41331194156bbb17078bcc1594f4952ac06a731e && \
|
2020-06-18 16:38:43 +00:00
|
|
|
go mod download && \
|
2024-03-05 18:50:35 +00:00
|
|
|
go install -a -x github.com/nsmfoo/dicompot/server
|
|
|
|
#
|
|
|
|
FROM alpine:3.19
|
2020-06-18 16:38:43 +00:00
|
|
|
#
|
|
|
|
# Setup dicompot
|
2024-03-05 18:50:35 +00:00
|
|
|
#
|
|
|
|
COPY --from=builder /opt/go/bin/server /opt/dicompot/server
|
|
|
|
COPY --from=builder /root/dist/dcm_pts/images /opt/dicompot/images
|
2020-06-18 16:38:43 +00:00
|
|
|
#
|
|
|
|
# Setup user, groups and configs
|
2024-03-05 18:50:35 +00:00
|
|
|
#
|
|
|
|
RUN addgroup -g 2000 dicompot && \
|
2020-06-18 16:38:43 +00:00
|
|
|
adduser -S -s /bin/ash -u 2000 -D -g 2000 dicompot && \
|
2024-03-05 18:50:35 +00:00
|
|
|
chown -R dicompot:dicompot /opt/dicompot
|
2020-06-18 16:38:43 +00:00
|
|
|
#
|
|
|
|
# Start dicompot
|
|
|
|
WORKDIR /opt/dicompot
|
|
|
|
USER dicompot:dicompot
|
2020-06-27 00:37:12 +00:00
|
|
|
CMD ["./server","-ip","0.0.0.0","-dir","images","-log","/var/log/dicompot/dicompot.log"]
|