forked from torrust/torrust-tracker
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6e8292a
commit c55d3fa
Showing
5 changed files
with
60 additions
and
4 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,6 @@ | ||
.git | ||
.github | ||
bin/docker/ | ||
data.db | ||
storage/ | ||
target/ |
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 @@ | ||
/target | ||
**/*.rs.bk | ||
/database.json.bz2 | ||
/database.db | ||
/.idea/ | ||
/config.toml | ||
/data.db | ||
/database.db | ||
/database.json.bz2 | ||
/storage/data.db | ||
/target |
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,40 @@ | ||
FROM lukemathwalker/cargo-chef:latest-rust-1.62.0 AS chef | ||
WORKDIR /app | ||
|
||
|
||
FROM chef AS planner | ||
COPY . . | ||
RUN cargo chef prepare --recipe-path recipe.json | ||
|
||
|
||
FROM chef AS builder | ||
COPY --from=planner /app/recipe.json recipe.json | ||
RUN cargo chef cook --release --recipe-path recipe.json | ||
COPY . . | ||
RUN cargo build --release --bin torrust-tracker | ||
|
||
|
||
FROM debian:bullseye-slim AS runtime | ||
WORKDIR /app | ||
|
||
ENV TZ=Etc/UTC \ | ||
APP_USER=appuser | ||
|
||
RUN groupadd $APP_USER \ | ||
&& useradd -g $APP_USER $APP_USER \ | ||
&& mkdir -p /app | ||
|
||
RUN chown -R $APP_USER:$APP_USER /app | ||
|
||
RUN apt-get -y update \ | ||
&& apt-get -y upgrade \ | ||
&& apt-get install -y sqlite3 libssl1.1 | ||
|
||
EXPOSE 6969 | ||
EXPOSE 1212 | ||
|
||
COPY --from=builder /app/target/release/torrust-tracker /app | ||
|
||
USER $APP_USER | ||
|
||
ENTRYPOINT ["/app/torrust-tracker"] |
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,3 @@ | ||
#!/bin/bash | ||
|
||
docker build -t torrust-tracker . |
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 @@ | ||
#!/bin/bash | ||
|
||
docker run --rm -it \ | ||
-p 6969:6969 -p 1212:1212 \ | ||
--volume "$(pwd)/storage":"/app/storage" \ | ||
--mount type=bind,source="$(pwd)/config.toml",target=/app/config.toml \ | ||
torrust-tracker |