forked from vlang/edu-platform
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dockerfile: reduce to single layer in final image, cleanup (vlang#4)
- Loading branch information
1 parent
612ea78
commit 4900abb
Showing
1 changed file
with
7 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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"] |