This commit is contained in:
cyc
2025-09-26 14:30:23 +08:00
commit a27e40ea9f
6 changed files with 105 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
/projects
.pnpm-store

49
Dockerfile Normal file
View File

@@ -0,0 +1,49 @@
# 使用官方 Ubuntu 基础镜像
FROM ubuntu:22.04
# 设置环境变量(避免交互提示)
ENV DEBIAN_FRONTEND=noninteractive \
JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64 \
PATH="$PATH:/usr/lib/jvm/java-17-openjdk-amd64/bin"
# 安装基础工具和依赖
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
curl \
gnupg \
software-properties-common
# 安装 Java 17
RUN apt-get install -y openjdk-17-jdk
# 安装 Maven
RUN apt-get install -y maven
# 安装 Git
RUN apt-get install -y git
# 安装 Node.js 和 npm
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
apt-get install -y nodejs
# 安装 pnpm
RUN npm install -g pnpm
# 清理缓存减小镜像体积
RUN apt-get autoremove -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# 验证安装
RUN java -version && \
mvn -v && \
git --version && \
node -v && \
pnpm -v
# 设置工作目录
WORKDIR /workspace
# 设置默认命令
CMD ["/bin/bash"]

3
build-backend.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/sh
docker exec build-image-dev-env-1 /workspace/projects/agt-build/build.sh backend

3
build-frontend.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/sh
docker exec build-image-dev-env-1 /workspace/projects/agt-build/build.sh frontend

39
cpto50.sh Executable file
View File

@@ -0,0 +1,39 @@
#!/bin/bash
latest_jar_file=./projects/agt-cloud/agt-server/target/agt-server.jar
latest_dist_file=./projects/agt-web/apps/web-antd/dist.zip
server_ip_50=192.168.9.50
debs_rel_dir=~/agt/
passwd=admin123
if [ -n "${latest_jar_file}" ]; then
expect <<EOF
set timeout -1
spawn rsync -avz ${latest_jar_file} manager@${server_ip_50}:${debs_rel_dir}
expect {
"yes/no" {
send "yes\n"
exp_continue
}
"password:" { send "$passwd\n" }
}
expect eof
EOF
fi
if [ -n "${latest_dist_file}" ]; then
expect <<EOF
set timeout -1
spawn rsync -avz ${latest_dist_file} manager@${server_ip_50}:${debs_rel_dir}
expect {
"yes/no" {
send "yes\n"
exp_continue
}
"password:" { send "$passwd\n" }
}
expect eof
EOF
fi

9
docker-compose.yml Normal file
View File

@@ -0,0 +1,9 @@
# docker-compose.yml
version: '3'
services:
dev-env:
image: my-dev-env:1.0
volumes:
- .:/workspace
tty: true # 保持容器运行
stdin_open: true