-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContainerfile
More file actions
45 lines (35 loc) · 983 Bytes
/
Containerfile
File metadata and controls
45 lines (35 loc) · 983 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#################
## Build Image ##
#################
FROM rust:alpine as builder
# Setup dependencies
RUN apk add --no-cache musl-dev npm
# Copy files to build Rust Application
WORKDIR /opt/kyubey
COPY ./build.rs ./build.rs
COPY ./Cargo.toml ./Cargo.toml
COPY ./Cargo.lock ./Cargo.lock
COPY ./package.json ./package.json
COPY ./package-lock.json ./package-lock.json
COPY ./.sqlx ./.sqlx
COPY ./src ./src
COPY ./tailwind.css ./tailwind.css
# Build Rust Application
RUN SQLX_OFFLINE=true cargo build --release --locked
###################
## Runtime Image ##
###################
FROM alpine:3
# Setup dependencies
RUN apk add --no-cache alpine-conf curl
# Setup Catalog2 User
RUN setup-user kyubey
USER kyubey
WORKDIR /home/kyubey
# Copy over complied runtime binary
COPY --from=builder /opt/kyubey/target/release/kyubey /usr/local/bin/kyubey
# Setup Healthcheck
HEALTHCHECK CMD curl --fail http://localhost:3000
# Run Catalog2
ENV RUST_BACKTRACE=full
ENTRYPOINT ["kyubey"]