Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker: fix copy server/static files #47

Merged
merged 2 commits into from
Nov 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading