mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
chore: use docker multi-stage builds
Previous image was 7.69GB which is somewhat heavy. Now the resulting image is 1.20GB thanks to multi-stage builds.
This commit is contained in:
parent
7eada39a8b
commit
ca0851418e
@ -1,4 +1,4 @@
|
|||||||
FROM archlinux/archlinux:base-devel
|
FROM archlinux/archlinux:base-devel as builder
|
||||||
|
|
||||||
RUN pacman -Syy
|
RUN pacman -Syy
|
||||||
|
|
||||||
@ -36,4 +36,25 @@ cargo install --force cargo-make && \
|
|||||||
cargo install --force duckscript_cli && \
|
cargo install --force duckscript_cli && \
|
||||||
cargo make flowy_dev && \
|
cargo make flowy_dev && \
|
||||||
cargo make -p production-linux-x86 appflowy-linux
|
cargo make -p production-linux-x86 appflowy-linux
|
||||||
CMD ["appflowy/frontend/app_flowy/product/0.0.3/linux/Release/AppFlowy/app_flowy"]
|
|
||||||
|
CMD ["/home/makepkg/appflowy/frontend/app_flowy/build/linux/x64/release/bundle/app_flowy"]
|
||||||
|
|
||||||
|
#################
|
||||||
|
FROM archlinux/archlinux:base-devel
|
||||||
|
|
||||||
|
RUN pacman -Syy
|
||||||
|
RUN pacman -Syu --needed --noconfirm xdg-user-dirs
|
||||||
|
RUN xdg-user-dirs-update
|
||||||
|
|
||||||
|
ARG user=makepkg
|
||||||
|
RUN useradd --system --create-home $user \
|
||||||
|
&& echo "$user ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers.d/$user
|
||||||
|
USER $user
|
||||||
|
WORKDIR /home/$user
|
||||||
|
|
||||||
|
COPY --from=builder /usr/sbin/yay /usr/sbin/yay
|
||||||
|
RUN yay -S --noconfirm gtk3
|
||||||
|
|
||||||
|
COPY --from=builder /home/makepkg/appflowy/frontend/app_flowy/build/linux/x64/release/bundle ./AppFlowy
|
||||||
|
|
||||||
|
CMD ["/home/makepkg/AppFlowy/app_flowy"]
|
||||||
|
@ -3,6 +3,7 @@ version: "3"
|
|||||||
services:
|
services:
|
||||||
app:
|
app:
|
||||||
build: .
|
build: .
|
||||||
|
image: appflowy/appflowy:latest
|
||||||
stdin_open: true
|
stdin_open: true
|
||||||
# tty: true
|
# tty: true
|
||||||
environment:
|
environment:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user