26 lines
443 B
Docker
26 lines
443 B
Docker
|
FROM docker.io/rust:1.67-alpine3.17 AS builder
|
||
|
|
||
|
RUN apk add --no-cache \
|
||
|
musl-dev
|
||
|
|
||
|
ADD . /src
|
||
|
WORKDIR /src
|
||
|
|
||
|
RUN cargo build --release
|
||
|
RUN strip target/release/woweb-poc
|
||
|
|
||
|
RUN adduser -D woweb
|
||
|
|
||
|
|
||
|
FROM scratch
|
||
|
|
||
|
COPY --from=builder /etc/passwd /etc/passwd
|
||
|
COPY --from=builder /src/target/release/woweb-poc "/opt/woweb-poc"
|
||
|
COPY --from=builder /src/assets "/opt/assets"
|
||
|
|
||
|
EXPOSE 3000
|
||
|
|
||
|
WORKDIR /opt
|
||
|
USER woweb
|
||
|
CMD ["/opt/woweb-poc", "0.0.0.0:3000"]
|