Skip to content

Commit

Permalink
Dockerfile: reduce to single layer in final image, cleanup (vlang#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
JalonSolov authored Feb 4, 2024
1 parent 612ea78 commit 4900abb
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,16 @@ RUN git clone --filter=blob:none https://github.com/vlang/v /vlang
RUN cd /vlang; make; /vlang/v version
RUN /vlang/v symlink

FROM buildv as buildapp
WORKDIR /app
WORKDIR /edu
COPY . .
COPY --from=buildv /vlang/v /vlang/v
RUN /vlang/v symlink
RUN /vlang/v -v install
RUN /vlang/v -compress -cflags -static -cc gcc -prod -d trace_request_url -skip-unused -o edu-platform .
RUN mkdir /app
RUN v -v install
RUN v -compress -cflags -static -cc gcc -prod -d trace_request_url -skip-unused -o /app/edu-platform .
RUN mv ./assets /app && mv ./lessons /app && mv ./templates /app

FROM scratch as final
FROM scratch
LABEL maintainer="Delyan Angelov <[email protected]>"
WORKDIR /app
COPY ./lessons ./lessons
COPY ./templates ./templates
COPY ./assets ./assets
COPY --from=buildapp /app/edu-platform ./edu-platform
COPY --from=buildv /app /app

EXPOSE 8082/tcp
ENTRYPOINT ["/app/edu-platform"]

0 comments on commit 4900abb

Please sign in to comment.