-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(docker): containerize the application
In this commit: - Define scripts, env file and Dockerfile to build and run the container - Get astarte config from env vars - Add dependabot checks for docker - Update Readme with the information to build and run a docker container Signed-off-by: Riccardo Gallo <[email protected]>
- Loading branch information
Showing
7 changed files
with
115 additions
and
0 deletions.
There are no files selected for viewing
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,8 @@ | ||
# Copyright 2024 SECO Mind Srl | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
/.github | ||
/.reuse | ||
/scripts/docker | ||
!/scripts/docker/entrypoint.sh |
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,7 @@ | ||
# Copyright 2024 SECO Mind Srl | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
MATH_FUNCTION=rect | ||
INTERVAL_BTW_SAMPLES=2000 | ||
SCALE=5 |
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,24 @@ | ||
# Copyright 2024 SECO Mind Srl | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
FROM rust:1.81-alpine3.20 AS build | ||
|
||
RUN mkdir /stream-rust-test && apk update && apk upgrade && \ | ||
apk add --no-cache alpine-sdk musl-dev pkgconfig openssl-dev openssl-libs-static sqlite-static sqlite-dev | ||
|
||
COPY . /stream-rust-test | ||
|
||
WORKDIR /stream-rust-test | ||
|
||
RUN cargo build --release | ||
|
||
FROM alpine:3.20 | ||
|
||
COPY scripts/docker/entrypoint.sh /entrypoint.sh | ||
|
||
COPY --from=build /stream-rust-test/target/release/stream-rust-test /usr/bin/ | ||
|
||
RUN mkdir -p /tmp/stream-rust-test/store/ | ||
|
||
CMD ["/entrypoint.sh"] |
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 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Copyright 2024 SECO Mind Srl | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
set -exEuo pipefail | ||
|
||
repo=$(git rev-parse --show-toplevel) | ||
|
||
cd "$repo" | ||
|
||
# Run the docker build context from the root of the repo | ||
docker build -f scripts/docker/Dockerfile . -t stream-rust-test:latest |
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,9 @@ | ||
#!/usr/bin/env sh | ||
|
||
# Copyright 2024 SECO Mind Srl | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
set -exu | ||
|
||
exec stream-rust-test |