Skip to content

Commit

Permalink
refactor: logic in docker environment
Browse files Browse the repository at this point in the history
  • Loading branch information
lvillis committed Oct 27, 2023
1 parent 8b91e4a commit 127d277
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 0 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,5 @@ COPY --from=build /opt/warpgate/target/release/warpgate /usr/local/bin/warpgate

VOLUME /data

ENV DOCKER 1

ENTRYPOINT ["warpgate", "--config", "/data/warpgate.yaml"]
CMD ["run"]
5 changes: 3 additions & 2 deletions warpgate/src/commands/common.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use tracing::*;
use std::path::Path;

pub(crate) fn assert_interactive_terminal() {
if !atty::is(atty::Stream::Stdin) {
Expand All @@ -11,5 +12,5 @@ pub(crate) fn assert_interactive_terminal() {
}

pub(crate) fn is_docker() -> bool {
std::env::var("DOCKER").is_ok()
}
Path::new("/.dockerenv").exists()
}

0 comments on commit 127d277

Please sign in to comment.