Skip to content

Commit

Permalink
Merge pull request #47 from duhow/fix-dockerfile
Browse files Browse the repository at this point in the history
docker: fix copy server/static files
  • Loading branch information
cschneider4711 authored Nov 4, 2023
2 parents b1f0f8a + b42a507 commit 9a8ced5
Showing 1 changed file with 24 additions and 18 deletions.
42 changes: 24 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,33 @@ RUN GOOS=linux go build -a -trimpath -ldflags="-s -w -X main.buildTimestamp=$(da
RUN cp /app/demo/example/threagile.yaml /app/demo/example/threagile-example-model.yaml && \
cp /app/demo/stub/threagile.yaml /app/demo/stub/threagile-stub-model.yaml

######
## Stage 3: Copy needed files into desired folder structure
######

FROM scratch AS files

COPY --from=build --chown=1000:1000 \
/app/threagile \
/app/raa.so \
/app/dummy.so \
/app/demo-rule.so \
/app/LICENSE.txt \
/app/report/template/background.pdf \
/app/support/openapi.yaml \
/app/support/schema.json \
/app/support/live-templates.txt \
/app/support/render-data-asset-diagram.sh \
/app/support/render-data-flow-diagram.sh \
/app/demo/example/threagile-example-model.yaml \
/app/demo/stub/threagile-stub-model.yaml \
\
/app/

COPY --from=build --chown=1000:1000 /app/server /app/server

######
## Stage 3: Make final small image
## Stage 4: Make final small image
######
FROM alpine

Expand All @@ -53,23 +75,7 @@ RUN apk add --update --no-cache ca-certificates \
mkdir -p /app /data && \
chown -R 1000:1000 /app /data

COPY --from=build --chown=1000:1000 \
/app/threagile \
/app/raa.so \
/app/dummy.so \
/app/demo-rule.so \
/app/LICENSE.txt \
/app/report/template/background.pdf \
/app/support/openapi.yaml \
/app/support/schema.json \
/app/support/live-templates.txt \
/app/support/render-data-asset-diagram.sh \
/app/support/render-data-flow-diagram.sh \
/app/demo/example/threagile-example-model.yaml \
/app/demo/stub/threagile-stub-model.yaml \
\
/app/
COPY --from=build --chown=1000:1000 /app/server /app/server/
COPY --from=files / /

USER 1000:1000
WORKDIR /app
Expand Down

0 comments on commit 9a8ced5

Please sign in to comment.