diff --git a/.dockerignore b/.dockerignore index c8833ad..ea6c311 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,5 +1,5 @@ **/.git **/node_modules -**/app +**/assets **/data/data.db **/certs \ No newline at end of file diff --git a/.gitignore b/.gitignore index 345701b..e88d5f9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules data.db -certs \ No newline at end of file +certs +assets \ No newline at end of file diff --git a/Dockerfile.dvza b/Dockerfile.dvza index fe71c8f..8ed9c2a 100644 --- a/Dockerfile.dvza +++ b/Dockerfile.dvza @@ -3,11 +3,12 @@ ## ## Build ## -FROM golang:1.18-alpine AS build +FROM golang:1.19-alpine AS build RUN apk update RUN apk upgrade RUN apk add build-base git +RUN apk add --update npm WORKDIR /app @@ -20,16 +21,20 @@ WORKDIR /app/dvzaservice RUN go build -o /app/bin/dvza +WORKDIR /app/dvzaservice/app +RUN npm i +RUN npx webpack + ## ## Deploy ## -FROM golang:1.18-alpine +FROM alpine WORKDIR / -COPY ./dvzaservice/assets /assets COPY ./dvzaservice/templates /templates COPY --from=build /app/bin/dvza ./dvza +COPY --from=build /app/dvzaservice/assets ./assets RUN adduser -D nonroot USER nonroot:nonroot diff --git a/Dockerfile.his b/Dockerfile.his index 3718897..577845e 100644 --- a/Dockerfile.his +++ b/Dockerfile.his @@ -3,11 +3,12 @@ ## ## Build ## -FROM golang:1.18-alpine AS build +FROM golang:1.19-alpine AS build RUN apk update RUN apk upgrade RUN apk add build-base git +RUN apk add --update npm WORKDIR /app @@ -20,17 +21,21 @@ WORKDIR /app/his RUN go build -o /app/bin/his +WORKDIR /app/his/app +RUN npm i +RUN npx webpack + ## ## Deploy ## -FROM golang:1.18-alpine +FROM alpine WORKDIR / -COPY ./his/assets /assets COPY ./his/templates /templates COPY ./his/patients /patients COPY --from=build /app/bin/his ./his +COPY --from=build /app/his/assets ./assets RUN adduser -D nonroot USER nonroot:nonroot diff --git a/Dockerfile.wbx b/Dockerfile.wbx index 26ce98f..ae2c29a 100644 --- a/Dockerfile.wbx +++ b/Dockerfile.wbx @@ -3,11 +3,12 @@ ## ## Build ## -FROM golang:1.18-alpine AS build +FROM golang:1.19-alpine AS build RUN apk update RUN apk upgrade RUN apk add build-base git +RUN apk add --update npm WORKDIR /app @@ -20,17 +21,21 @@ WORKDIR /app/whiteboxservice RUN go build -o /app/bin/wbx +WORKDIR /app/whiteboxservice/app +RUN npm i +RUN npx webpack + ## ## Deploy ## -FROM golang:1.18-alpine +FROM alpine WORKDIR / -COPY ./whiteboxservice/assets /assets COPY ./whiteboxservice/templates /templates COPY ./whiteboxservice/bin/amd64 /wbxbin COPY --from=build /app/bin/wbx ./wbx +COPY --from=build /app/whiteboxservice/assets ./assets RUN adduser -D nonroot USER nonroot:nonroot