sterepando commited on
Commit
6e9b7b9
·
verified ·
1 Parent(s): 1bd97cc

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -8
Dockerfile CHANGED
@@ -1,6 +1,6 @@
1
  FROM rust:slim-bullseye
2
 
3
- # 1. Установка системных зависимостей
4
  RUN apt-get update && apt-get install -y \
5
  curl \
6
  unzip \
@@ -8,6 +8,7 @@ RUN apt-get update && apt-get install -y \
8
  libssl-dev \
9
  pkg-config \
10
  zip \
 
11
  && rm -rf /var/lib/apt/lists/*
12
 
13
  # 2. Установка Android NDK
@@ -28,7 +29,7 @@ RUN cargo install cargo-ndk
28
  WORKDIR /app
29
  RUN cargo init --lib --name vless_core
30
 
31
- # 5. Создание Cargo.toml (через cat EOF для надежности)
32
  RUN cat <<EOF > Cargo.toml
33
  [package]
34
  name = "vless_core"
@@ -49,7 +50,7 @@ serde = { version = "1.0", features = ["derive"] }
49
  serde_json = "1.0"
50
  EOF
51
 
52
- # 6. Создание src/lib.rs (Исправлен импорт Serde)
53
  RUN cat <<EOF > src/lib.rs
54
  use std::ffi::CStr;
55
  use std::os::raw::{c_char, c_int};
@@ -58,7 +59,7 @@ use log::{info, error, LevelFilter};
58
  use android_logger::Config;
59
  use tokio::runtime::Runtime;
60
  use tokio::task::JoinHandle;
61
- use serde::Deserialize; // Явный импорт для устранения ошибки E0277
62
 
63
  lazy_static::lazy_static! {
64
  static ref RUNTIME: Runtime = Runtime::new().unwrap();
@@ -71,7 +72,6 @@ pub extern "C" fn init_logger() {
71
  info!("Native Logger Initialized");
72
  }
73
 
74
- // Добавлен дериватив Deserialize
75
  #[derive(Deserialize)]
76
  struct VlessConfig {
77
  uuid: String,
@@ -82,7 +82,7 @@ struct VlessConfig {
82
  async fn vless_worker(config: VlessConfig) {
83
  info!("Starting VLESS Core connecting to {}:{}", config.address, config.port);
84
  loop {
85
- // Здесь будет реальная логика VLESS (TCP/UDP стримы)
86
  info!("VLESS Keepalive: Ping to {}", config.address);
87
  tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
88
  }
@@ -133,6 +133,6 @@ RUN cargo ndk -t armeabi-v7a -t arm64-v8a -t x86_64 -o ./jniLibs build --release
133
  WORKDIR /app
134
  RUN zip -r vless_libs.zip jniLibs
135
 
136
- # 9. Сервер раздачи
137
  EXPOSE 7860
138
- CMD ["python3", "-m", "http.server", "7860"]
 
1
  FROM rust:slim-bullseye
2
 
3
+ # 1. Установка системных зависимостей (включая python3)
4
  RUN apt-get update && apt-get install -y \
5
  curl \
6
  unzip \
 
8
  libssl-dev \
9
  pkg-config \
10
  zip \
11
+ python3 \
12
  && rm -rf /var/lib/apt/lists/*
13
 
14
  # 2. Установка Android NDK
 
29
  WORKDIR /app
30
  RUN cargo init --lib --name vless_core
31
 
32
+ # 5. Создание Cargo.toml
33
  RUN cat <<EOF > Cargo.toml
34
  [package]
35
  name = "vless_core"
 
50
  serde_json = "1.0"
51
  EOF
52
 
53
+ # 6. Создание src/lib.rs
54
  RUN cat <<EOF > src/lib.rs
55
  use std::ffi::CStr;
56
  use std::os::raw::{c_char, c_int};
 
59
  use android_logger::Config;
60
  use tokio::runtime::Runtime;
61
  use tokio::task::JoinHandle;
62
+ use serde::Deserialize;
63
 
64
  lazy_static::lazy_static! {
65
  static ref RUNTIME: Runtime = Runtime::new().unwrap();
 
72
  info!("Native Logger Initialized");
73
  }
74
 
 
75
  #[derive(Deserialize)]
76
  struct VlessConfig {
77
  uuid: String,
 
82
  async fn vless_worker(config: VlessConfig) {
83
  info!("Starting VLESS Core connecting to {}:{}", config.address, config.port);
84
  loop {
85
+ // Здесь будет логика подключения
86
  info!("VLESS Keepalive: Ping to {}", config.address);
87
  tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
88
  }
 
133
  WORKDIR /app
134
  RUN zip -r vless_libs.zip jniLibs
135
 
136
+ # 9. Сервер раздачи (Используем полный путь к python3)
137
  EXPOSE 7860
138
+ CMD ["/usr/bin/python3", "-m", "http.server", "7860"]