github.com/uvalib/orcid-access-ws@v0.0.0-20250612130209-7d062dbabf9d/package/Dockerfile (about) 1 # 2 # build the target application 3 # 4 FROM public.ecr.aws/docker/library/golang:1.24.4-alpine3.22 AS builder 5 6 # update the packages 7 RUN apk update && apk upgrade && apk add --no-cache make 8 9 WORKDIR /build 10 COPY go.mod go.sum Makefile ./ 11 COPY orcidaccessws ./orcidaccessws 12 RUN make build-linux 13 14 # 15 # build the target container 16 # 17 FROM public.ecr.aws/docker/library/alpine:3.22 18 19 # update the packages 20 RUN apk update && apk upgrade && apk add bash tzdata ca-certificates curl && rm -fr /var/cache/apk/* 21 22 # Create the run user and group 23 RUN addgroup --gid 18570 sse && adduser --uid 1984 docker -G sse -D 24 25 # set the timezone appropriatly 26 ENV TZ=UTC 27 RUN cp /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone 28 29 # Specify home 30 ENV APP_HOME=/orcid-access-ws 31 WORKDIR $APP_HOME 32 33 # Create necessary directories 34 RUN mkdir -p $APP_HOME/scripts $APP_HOME/bin $APP_HOME/data $APP_HOME/assets 35 RUN chown -R docker $APP_HOME && chgrp -R sse $APP_HOME 36 37 # port and run command 38 EXPOSE 8080 39 CMD ["scripts/entry.sh"] 40 41 # Move in necessary assets 42 COPY scripts/entry.sh $APP_HOME/scripts/entry.sh 43 COPY data/container_bash_profile /home/docker/.profile 44 COPY data/work-activity-template.xml $APP_HOME/data/work-activity-template.xml 45 COPY assets/* $APP_HOME/assets/ 46 COPY --from=builder /build/bin/orcid-access-ws.linux $APP_HOME/bin/orcid-access-ws 47 48 # Ensure permissions are correct 49 RUN chown docker:sse /home/docker/.profile $APP_HOME/scripts/entry.sh $APP_HOME/bin/orcid-access-ws $APP_HOME/data/work-activity-template.xml && chmod 755 /home/docker/.profile $APP_HOME/scripts/entry.sh $APP_HOME/bin/orcid-access-ws 50 51 # Add the build tag 52 ARG BUILD_TAG 53 RUN test -n "$BUILD_TAG" && touch $APP_HOME/buildtag.build-$BUILD_TAG || touch $APP_HOME/buildtag.build-0 54 55 # Specify the user 56 USER docker 57 58 # 59 # end of file 60 #