-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add news service to deployment
* rename api service to users service
- Loading branch information
1 parent
d762c37
commit 59a406a
Showing
59 changed files
with
258 additions
and
83 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
[workspace] | ||
|
||
members = [ | ||
"api", | ||
"users", | ||
"consumer", | ||
"utils", | ||
"news" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
ARG RUST_VERSION=1.72.0 | ||
ARG APP_NAME=news | ||
FROM rust:${RUST_VERSION}-slim-bullseye AS build | ||
ARG APP_NAME | ||
WORKDIR /app | ||
|
||
# dependencies to compile the Kafka client | ||
RUN apt-get update && apt-get install -y build-essential \ | ||
curl \ | ||
openssl libssl-dev \ | ||
pkg-config \ | ||
python \ | ||
valgrind \ | ||
zlib1g-dev | ||
|
||
# dependencies to compile diesel client | ||
RUN apt-get install -y \ | ||
libpq-dev | ||
|
||
RUN echo "[workspace]\n\ | ||
members = [\n\ | ||
\"news\",\n\ | ||
\"utils\"\n\ | ||
]" > ./Cargo.toml | ||
|
||
COPY ./news/Cargo.toml ./news/ | ||
COPY ./utils/Cargo.toml ./utils/ | ||
|
||
RUN mkdir news/src | ||
RUN echo "fn main() {}" > ./news/src/main.rs | ||
|
||
RUN mkdir utils/src | ||
RUN echo "fn main() {}" > ./utils/src/main.rs | ||
|
||
RUN cargo build --release | ||
|
||
COPY ./utils/src ./utils/src | ||
COPY ./news/src ./news/src | ||
|
||
RUN cargo build --release | ||
|
||
RUN cp ./target/release/$APP_NAME /bin/server | ||
|
||
|
||
FROM debian:bullseye-slim AS final | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
libpq-dev \ | ||
openssl libssl-dev \ | ||
ca-certificates | ||
|
||
COPY --from=build /bin/server /bin/ | ||
|
||
EXPOSE 8001 | ||
|
||
CMD ["/bin/server"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
ARG RUST_VERSION=1.72.0 | ||
ARG APP_NAME=users | ||
FROM rust:${RUST_VERSION}-slim-bullseye AS build | ||
ARG APP_NAME | ||
WORKDIR /app | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
libpq-dev | ||
|
||
RUN cargo install diesel_cli --no-default-features --features postgres | ||
|
||
COPY ./users/migrations /app/migrations | ||
|
||
CMD ["diesel","migration","run"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.