aurcache/Dockerfile

42 lines
956 B
Docker
Raw Normal View History

FROM ghcr.io/cirruslabs/flutter:latest AS frontend_builder
WORKDIR /app
COPY frontend /app
RUN flutter build web --release
2023-12-23 18:27:36 +00:00
FROM rust AS builder
# Install necessary tools and dependencies
WORKDIR /app
# Copy the Rust project files
COPY backend/src /app/src
COPY backend/scripts /app/scripts
COPY backend/Cargo.lock /app
COPY backend/Cargo.toml /app
COPY --from=frontend_builder /app/build/web /app/web
2023-12-23 18:27:36 +00:00
# Build the Rust binary
RUN cargo build --release --features static
2023-12-23 18:27:36 +00:00
# Stage 2: Create the final image
FROM archlinux
# Copy the built binary from the previous stage
COPY --from=builder /app/target/release/untitled /usr/local/bin/untitled
RUN echo " \
[extra]\
Include = /etc/pacman.d/mirrorlist" >> /etc/pacman.conf
2023-12-23 18:27:36 +00:00
RUN pacman -Syyu --noconfirm
RUN pacman-key --init && pacman-key --populate
2023-12-23 18:27:36 +00:00
RUN pacman -S --noconfirm base-devel git
RUN pacman -Sc
# Set the entry point or default command to run your application
WORKDIR /app
2023-12-23 18:27:36 +00:00
CMD ["untitled"]