[#26] Moved main binary to separate location

master^2
Jef Roosens 2021-04-15 19:26:37 +02:00
parent 37c9b397b4
commit cb78af62ba
Signed by: Jef Roosens
GPG Key ID: B580B976584B5F30
4 changed files with 8 additions and 8 deletions

View File

@ -5,7 +5,7 @@ authors = ["Jef Roosens <roosensjef@gmail.com>"]
edition = "2018" edition = "2018"
[lib] [lib]
name = "fej_lib" name = "fej"
src = "src/lib.rs" src = "src/lib.rs"
test = true test = true
bench = true bench = true
@ -13,8 +13,8 @@ doc = true
doctest = true doctest = true
[[bin]] [[bin]]
name = "fej" name = "server"
src = "src/main.rs" src = "src/bin/server/main.rs"
test = false test = false
bench = false bench = false
doc = false doc = false

View File

@ -3,4 +3,4 @@ FROM chewingbever/fej-builder:latest
ENV RUST_BACKTRACE 1 ENV RUST_BACKTRACE 1
ENTRYPOINT ["cargo"] ENTRYPOINT ["cargo"]
CMD ["run"] CMD ["run", "--bin", "server"]

View File

@ -7,7 +7,7 @@ FROM chewingbever/fej-builder:latest AS builder
# NOTE: cargo install auto-appends bin to the path # NOTE: cargo install auto-appends bin to the path
RUN --mount=type=cache,target=/usr/src/app/target \ RUN --mount=type=cache,target=/usr/src/app/target \
--mount=type=cache,target=/root/.cargo/registry \ --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 # Now, we create the actual image
@ -17,7 +17,7 @@ FROM alpine:latest
RUN apk update && apk add --no-cache openssl libgcc curl RUN apk update && apk add --no-cache openssl libgcc curl
# Copy binary over to final image # 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 \ HEALTHCHECK \
--interval=10s \ --interval=10s \
@ -26,4 +26,4 @@ HEALTHCHECK \
--retries=3 \ --retries=3 \
CMD curl -q localhost:8000 CMD curl -q localhost:8000
CMD ["/usr/local/bin/fej"] CMD ["/usr/local/bin/server"]

View File

@ -1,7 +1,7 @@
#[macro_use] #[macro_use]
extern crate rocket; extern crate rocket;
use fej_lib::{catchers, ivago}; use fej::{catchers, ivago};
// Very temporary solution for CORS // Very temporary solution for CORS
// https://stackoverflow.com/questions/62412361/how-to-set-up-cors-or-options-for-rocket-rs // https://stackoverflow.com/questions/62412361/how-to-set-up-cors-or-options-for-rocket-rs