Commit b2104a6e authored by xingyuji's avatar xingyuji

1.BCodeLxcServiceImpl 路径改动

2.Dockerfiel.ftl 配置改动
3.java 的Docker-compose配置文件去掉maven的配置文件映射
4.生产环境配置文件,修改redis的host和port配置
parent 1bdf080f
package org.rcisoft.business.bcode.service.impl; package org.rcisoft.business.bcode.service.impl;
import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.quartz.*; import org.quartz.*;
import org.rcisoft.business.bcode.model.BCodeLxc; import org.rcisoft.business.bcode.model.BCodeLxc;
...@@ -82,8 +83,8 @@ public class BCodeLxcServiceImpl implements BCodeLxcService { ...@@ -82,8 +83,8 @@ public class BCodeLxcServiceImpl implements BCodeLxcService {
param.put("lxcCode",lxc.getUserCode()); param.put("lxcCode",lxc.getUserCode());
param.put("lxcSshPort",portSSH); param.put("lxcSshPort",portSSH);
/* config path*/ /* config path*/
String destPath = global.getBASE_UPLOAD_SERVER_LOCATION() + File.separator + String destPath = global.getBASE_UPLOAD_SERVER_LOCATION() +
global.getLxcDockerfilePath() + File.separator + lxc.getUserId() + File.separator; global.getLxcDockerfilePath() + "/" + lxc.getUserId() + "/";
/*启动路径*/ /*启动路径*/
String dockerPath = global.getPHYSICAL_UPLOAD_SERVER_LOCATION() + String dockerPath = global.getPHYSICAL_UPLOAD_SERVER_LOCATION() +
global.getLxcDockerfilePath() + "/" + lxc.getUserId() + "/"; global.getLxcDockerfilePath() + "/" + lxc.getUserId() + "/";
......
...@@ -3,6 +3,7 @@ package org.rcisoft.core.util; ...@@ -3,6 +3,7 @@ package org.rcisoft.core.util;
import freemarker.template.Configuration; import freemarker.template.Configuration;
import freemarker.template.Template; import freemarker.template.Template;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.rcisoft.common.component.Global; import org.rcisoft.common.component.Global;
import org.rcisoft.core.command.LxcCommand; import org.rcisoft.core.command.LxcCommand;
...@@ -53,6 +54,10 @@ public class FreemarkerUtil { ...@@ -53,6 +54,10 @@ public class FreemarkerUtil {
Template template = freemarkerConfiguration.getTemplate("lxc" + File.separator + model + File.separator + LxcCommand.LXC_JAVA_NAME + ".ftl"); Template template = freemarkerConfiguration.getTemplate("lxc" + File.separator + model + File.separator + LxcCommand.LXC_JAVA_NAME + ".ftl");
template.process(param,new FileWriter(new File(destPath + "java" + File.separator + LxcCommand.LXC_JAVA_NAME))); template.process(param,new FileWriter(new File(destPath + "java" + File.separator + LxcCommand.LXC_JAVA_NAME)));
// File fromFile = new File(this.getClass().getResource("/").getPath() +"templates/lxc" + File.separator + model + File.separator + "settings.xml");
// File toFile = new File(destPath + "java" + File.separator + "settings.xml");
// FileUtils.copyFile(fromFile,toFile);
} }
Template template = freemarkerConfiguration.getTemplate("lxc" + File.separator + model + ".ftl"); // freeMarker template Template template = freemarkerConfiguration.getTemplate("lxc" + File.separator + model + ".ftl"); // freeMarker template
......
...@@ -6,9 +6,10 @@ server: ...@@ -6,9 +6,10 @@ server:
#uri-encoding: UTF-8 #uri-encoding: UTF-8
#logging: #logging:
# path:/working/resource/eduServer/SpringBootLog
# level: # level:
# root: INFO # root: INFO
# org.springframework.web: DEBUG # org.springframework.web: info
druid: druid:
url: jdbc:mysql://edu2_mysql:3306/edu_db?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false url: jdbc:mysql://edu2_mysql:3306/edu_db?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false
...@@ -54,8 +55,8 @@ spring: ...@@ -54,8 +55,8 @@ spring:
resources: resources:
add-mappings: false add-mappings: false
redis: redis:
host: 106.2.3.134 host: edu2_redis
port: 7482 port: 6379
pool: pool:
max-idle: 50 max-idle: 50
max-active: 1000 max-active: 1000
......
...@@ -10,5 +10,5 @@ services: ...@@ -10,5 +10,5 @@ services:
- '${lxcSshPort?c}:22' - '${lxcSshPort?c}:22'
volumes: volumes:
- ${lxcPath}:/working/code - ${lxcPath}:/working/code
- /working/dockervolume/edu2_data_ubuntu/eduMaven/:/working/resource/eduMaven/ #- /working/dockervolume/edu2_data_ubuntu/eduMaven/:/working/resource/eduMaven/
command: tail -f /dev/null command: tail -f /dev/null
\ No newline at end of file
FROM java_exam_cy:0.2
COPY settings.xml /usr/share/apache-maven-3.3.9/conf/
RUN groupadd java_${lxcCode}
RUN useradd -g java_${lxcCode} user_${lxcCode}
RUN usermod -s /bin/bash user_${lxcCode}
RUN echo "user_${lxcCode}:${lxcCode}" | chpasswd
expose 22
expose 8080
ENTRYPOINT ["/bin/bash","/run.sh"]
\ No newline at end of file
FROM java_exam_cy:0.1 FROM java_exam_cy:0.1
COPY settings.xml /usr/share/apache-maven-3.3.9/conf/
RUN groupadd java_${lxcCode} RUN echo "root:${lxcCode}" | chpasswd
RUN useradd -g java_${lxcCode} user_${lxcCode}
RUN echo "user_${lxcCode}:${lxcCode}" | chpasswd
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment