-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Dockerfile.tools
27 lines (26 loc) · 1.12 KB
/
Dockerfile.tools
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Development
FROM golang:1.22.2-alpine AS development
WORKDIR /go/src/github.com/tidepool-org/platform
RUN echo 'http://dl-cdn.alpinelinux.org/alpine/v3.9/community' >> /etc/apk/repositories && \
echo 'http://dl-cdn.alpinelinux.org/alpine/v3.9/main' >> /etc/apk/repositories && \
apk --no-cache add ca-certificates tzdata make git mongodb yaml-cpp=0.6.2-r2&& \
go install github.com/githubnemo/[email protected] && \
adduser -D tidepool && \
chown -R tidepool /go/src/github.com/tidepool-org/platform
USER tidepool
COPY --chown=tidepool . .
ENV SERVICE=tools
RUN ["make", "service-build"]
CMD ["make", "service-start"]
# Production
FROM mongo:6.0.14 AS production
# this statically set $HOME is non-ideal, but is to combat it being hardcoded to /data/db upstream
ENV HOME="/home/tidepool/" DEBIAN_FRONTEND="noninteractive"
RUN apt -y update && \
apt -y install ca-certificates tzdata && \
adduser --disabled-password tidepool
WORKDIR /home/tidepool
USER tidepool
COPY --from=development --chown=tidepool /go/src/github.com/tidepool-org/platform/_bin/tools/ .
COPY ./tools/ashrc /home/tidepool/.bashrc
CMD ["./tools"]