[#26] Moved main binary to separate location
parent
37c9b397b4
commit
cb78af62ba
|
@ -5,7 +5,7 @@ authors = ["Jef Roosens <roosensjef@gmail.com>"]
|
|||
edition = "2018"
|
||||
|
||||
[lib]
|
||||
name = "fej_lib"
|
||||
name = "fej"
|
||||
src = "src/lib.rs"
|
||||
test = true
|
||||
bench = true
|
||||
|
@ -13,8 +13,8 @@ doc = true
|
|||
doctest = true
|
||||
|
||||
[[bin]]
|
||||
name = "fej"
|
||||
src = "src/main.rs"
|
||||
name = "server"
|
||||
src = "src/bin/server/main.rs"
|
||||
test = false
|
||||
bench = false
|
||||
doc = false
|
||||
|
|
|
@ -3,4 +3,4 @@ FROM chewingbever/fej-builder:latest
|
|||
ENV RUST_BACKTRACE 1
|
||||
|
||||
ENTRYPOINT ["cargo"]
|
||||
CMD ["run"]
|
||||
CMD ["run", "--bin", "server"]
|
||||
|
|
|
@ -7,7 +7,7 @@ FROM chewingbever/fej-builder:latest AS builder
|
|||
# NOTE: cargo install auto-appends bin to the path
|
||||
RUN --mount=type=cache,target=/usr/src/app/target \
|
||||
--mount=type=cache,target=/root/.cargo/registry \
|
||||
cargo install --path . --bin fej --root /usr/local
|
||||
cargo install --path . --root /usr/local
|
||||
|
||||
|
||||
# Now, we create the actual image
|
||||
|
@ -17,7 +17,7 @@ FROM alpine:latest
|
|||
RUN apk update && apk add --no-cache openssl libgcc curl
|
||||
|
||||
# Copy binary over to final image
|
||||
COPY --from=builder /usr/local/bin/fej /usr/local/bin/fej
|
||||
COPY --from=builder /usr/local/bin/server /usr/local/bin/server
|
||||
|
||||
HEALTHCHECK \
|
||||
--interval=10s \
|
||||
|
@ -26,4 +26,4 @@ HEALTHCHECK \
|
|||
--retries=3 \
|
||||
CMD curl -q localhost:8000
|
||||
|
||||
CMD ["/usr/local/bin/fej"]
|
||||
CMD ["/usr/local/bin/server"]
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#[macro_use]
|
||||
extern crate rocket;
|
||||
|
||||
use fej_lib::{catchers, ivago};
|
||||
use fej::{catchers, ivago};
|
||||
|
||||
// Very temporary solution for CORS
|
||||
// https://stackoverflow.com/questions/62412361/how-to-set-up-cors-or-options-for-rocket-rs
|
Loading…
Reference in New Issue