chore: containerise

This commit is contained in:
Compositr 2024-11-03 22:16:22 +11:00
parent d554e688e2
commit d8f5302c08
2 changed files with 33 additions and 0 deletions

10
.dockerignore Normal file
View file

@ -0,0 +1,10 @@
.git
.config
target/
.gitignore
.gitmodules
*.md
cspell*
.editorconfig
.dockerignore
Dockerfile

23
Dockerfile Normal file
View file

@ -0,0 +1,23 @@
## Builder ##
FROM rust:1.80-alpine AS builder
WORKDIR /usr/src/luciders
COPY . .
# 32-bit musl-dev for indoc! macro dep.
RUN apk add --no-cache musl-dev
RUN cargo build --release
## Runner ##
FROM alpine:3.20 AS runner
RUN adduser -D -u 1000 lucidersuser
USER lucidersuser
WORKDIR /home/lucidersuser/app
COPY --from=builder --chown=lucidersuser:lucidersuser /usr/src/luciders/target/release/luciders .
COPY --from=builder --chown=lucidersuser:lucidersuser /usr/src/luciders/vendor/lucide/icons ./vendor/lucide/icons
EXPOSE 7878
CMD [ "./luciders" ]