2022-10-09 12:08:23 -06:00
|
|
|
#########################################################################################################
|
|
|
|
# Frontend Build
|
|
|
|
#########################################################################################################
|
2022-09-21 19:57:38 -06:00
|
|
|
FROM node:18.9.0 as frontend-build
|
|
|
|
WORKDIR /usr/src/fastenhealth/frontend
|
|
|
|
#COPY frontend/package.json frontend/yarn.lock ./
|
|
|
|
COPY frontend/package.json ./
|
2022-09-27 09:27:06 -06:00
|
|
|
#COPY frontend/yarn.lock ./
|
|
|
|
RUN yarn config set registry "http://registry.npmjs.org" \
|
2022-09-27 09:28:11 -06:00
|
|
|
&& yarn install --frozen-lockfile --network-timeout 100000
|
2022-09-21 19:57:38 -06:00
|
|
|
COPY frontend/ ./
|
2022-09-26 23:41:39 -06:00
|
|
|
RUN yarn run build -- --configuration sandbox --output-path=../dist
|
2022-09-21 19:57:38 -06:00
|
|
|
|
2022-10-09 12:08:23 -06:00
|
|
|
#########################################################################################################
|
|
|
|
# Backend Build
|
|
|
|
#########################################################################################################
|
2022-09-21 19:57:38 -06:00
|
|
|
FROM golang:1.18 as backend-build
|
2022-11-01 00:08:42 -06:00
|
|
|
ENV FASTEN_COUCHDB_ADMIN_USERNAME=admin
|
|
|
|
ENV FASTEN_COUCHDB_ADMIN_PASSWORD=mysecretpassword
|
|
|
|
ENV FASTEN_ISSUER_JWT_KEY=mysessionpassword
|
|
|
|
|
2022-09-21 19:57:38 -06:00
|
|
|
WORKDIR /go/src/github.com/fastenhealth/fastenhealth-onprem
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
RUN go mod vendor \
|
|
|
|
&& go install github.com/golang/mock/mockgen@v1.6.0 \
|
|
|
|
&& go generate ./... \
|
|
|
|
&& go vet ./... \
|
|
|
|
&& go test ./...
|
|
|
|
RUN CGO_ENABLED=0 go build -o /go/bin/fasten ./backend/cmd/fasten/
|
|
|
|
|
2022-09-26 23:14:29 -06:00
|
|
|
# create folder structure
|
|
|
|
RUN mkdir -p /opt/fasten/db \
|
2022-09-27 23:23:40 -06:00
|
|
|
&& mkdir -p /opt/fasten/web \
|
|
|
|
&& mkdir -p /opt/fasten/config \
|
|
|
|
&& curl -o /opt/fasten/db/fasten.db -L https://github.com/fastenhealth/testdata/raw/main/fasten.db
|
2022-09-26 23:14:29 -06:00
|
|
|
|
2022-09-21 19:57:38 -06:00
|
|
|
|
2022-10-09 12:08:23 -06:00
|
|
|
#########################################################################################################
|
|
|
|
# Distribution Build
|
|
|
|
#########################################################################################################
|
|
|
|
FROM couchdb:3.2
|
|
|
|
|
|
|
|
ARG S6_ARCH=amd64
|
|
|
|
RUN curl https://github.com/just-containers/s6-overlay/releases/download/v1.21.8.0/s6-overlay-${S6_ARCH}.tar.gz -L -s --output /tmp/s6-overlay-${S6_ARCH}.tar.gz \
|
|
|
|
&& tar xzf /tmp/s6-overlay-${S6_ARCH}.tar.gz -C / \
|
|
|
|
&& rm -rf /tmp/s6-overlay-${S6_ARCH}.tar.gz
|
|
|
|
|
|
|
|
COPY /docker/couchdb/local.ini /opt/couchdb/etc/
|
|
|
|
COPY /docker/rootfs /
|
2022-09-26 23:14:29 -06:00
|
|
|
|
|
|
|
WORKDIR /opt/fasten/
|
|
|
|
COPY --from=backend-build /opt/fasten/ /opt/fasten/
|
|
|
|
COPY --from=frontend-build /usr/src/fastenhealth/dist /opt/fasten/web
|
2022-09-21 19:57:38 -06:00
|
|
|
COPY --from=backend-build /go/bin/fasten /opt/fasten/fasten
|
2022-09-25 12:14:00 -06:00
|
|
|
COPY LICENSE.md /opt/fasten/LICENSE.md
|
2022-09-26 23:14:29 -06:00
|
|
|
COPY config.yaml /opt/fasten/config/config.yaml
|
2022-10-09 12:08:23 -06:00
|
|
|
|
|
|
|
ENTRYPOINT ["/init"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|