forked from Maurice/pastabble
Pastabble frontend
This commit is contained in:
32
Containerfile
Normal file
32
Containerfile
Normal file
@@ -0,0 +1,32 @@
|
||||
FROM node:21-alpine3.19 AS frontend-builder
|
||||
WORKDIR /build
|
||||
|
||||
RUN corepack enable
|
||||
COPY pastabble-frontend/ .
|
||||
RUN pnpm i && pnpm build
|
||||
|
||||
FROM rust:alpine3.19 AS builder
|
||||
WORKDIR /build
|
||||
|
||||
RUN apk add --no-cache musl-dev
|
||||
COPY . ./
|
||||
RUN apk --print-arch
|
||||
RUN case "$(apk --print-arch)" in \
|
||||
x86_64) cargo build --target x86_64-unknown-linux-musl --release; \
|
||||
mv ./target/x86_64-unknown-linux-musl /release ;; \
|
||||
aarch64) cargo build --target aarch64-unknown-linux-musl --release; \
|
||||
mv ./target/aarch64-unknown-linux-musl /release ;; \
|
||||
esac
|
||||
|
||||
FROM alpine:edge
|
||||
WORKDIR /app
|
||||
RUN mkdir /app/wwwroot
|
||||
|
||||
# /* removes directory structure
|
||||
COPY --from=builder /release/* /app
|
||||
COPY ./about.html /app/about.html
|
||||
COPY --from=frontend-builder /build/dist /app/wwwroot
|
||||
|
||||
ENV WWW_DIR /app/wwwroot
|
||||
EXPOSE 8080
|
||||
CMD [ "./pastabble" ]
|
||||
Reference in New Issue
Block a user