Browse Source

docker的支持

sunlightcs 7 years ago
parent
commit
4f437cb04b
5 changed files with 18 additions and 13 deletions
  1. 1 1
      Dockerfile
  2. 2 2
      README.md
  3. 4 2
      docker-compose.yml
  4. 9 7
      pom.xml
  5. 2 1
      src/main/resources/application.yml

+ 1 - 1
Dockerfile

@ -1,5 +1,5 @@
1 1
FROM java:8
2
EXPOSE 80
2
EXPOSE 8080
3 3
4 4
VOLUME /tmp
5 5
ADD renren-fast-1.2.0.jar /app.jar

+ 2 - 2
README.md

@ -75,9 +75,9 @@ renren-fast
75 75
- 执行doc/db.sql文件,初始化数据
76 76
- 修改application-dev.yml,更新MySQL账号和密码
77 77
- Eclipse、IDEA运行RenrenApplication.java,则可启动项目
78
- 项目访问路径:http://localhost
78
- 项目访问路径:http://localhost:8080/renren-fast
79 79
- 账号密码:admin/admin
80
- Swagger路径:http://localhost/swagger/index.html
80
- Swagger路径:http://localhost:8080/renren-fast/swagger/index.html
81 81
82 82
83 83
 **项目演示**

+ 4 - 2
docker-compose.yml

@ -1,6 +1,8 @@
1 1
version: '2'
2 2
services:
3
  campus:
3
  renren-fast:
4 4
    image: renren/fast
5 5
    ports:
6
      - "80:80"
6
      - "8080:8080"
7
    environment:
8
      - spring.profiles.active=dev

+ 9 - 7
pom.xml

@ -200,6 +200,7 @@
200 200
					<displayCommandOutputs>true</displayCommandOutputs>
201 201
				</configuration>
202 202
			</plugin>
203
203 204
			<plugin>
204 205
				<groupId>com.spotify</groupId>
205 206
				<artifactId>docker-maven-plugin</artifactId>
@ -215,14 +216,15 @@
215 216
				<configuration>
216 217
					<imageName>renren/fast</imageName>
217 218
					<dockerDirectory>${project.basedir}</dockerDirectory>
218
					<!--<resources>-->
219
						<!--<resource>-->
220
							<!--<targetPath>/</targetPath>-->
221
							<!--<directory>${project.build.directory}</directory>-->
222
							<!--<include>${project.build.finalName}.jar</include>-->
223
						<!--</resource>-->
224
					<!--</resources>-->
219
					<resources>
220
						<resource>
221
							<targetPath>/</targetPath>
222
							<directory>${project.build.directory}</directory>
223
							<include>${project.build.finalName}.jar</include>
224
						</resource>
225
					</resources>
225 226
				</configuration>
227
				<!-- 运行命令 mvn clean package docker:build 打包并生成docker镜像 -->
226 228
			</plugin>
227 229
		</plugins>
228 230
	</build>

+ 2 - 1
src/main/resources/application.yml

@ -4,7 +4,8 @@ server:
4 4
        uri-encoding: UTF-8
5 5
        max-threads: 1000
6 6
        min-spare-threads: 30
7
    port: 80
7
    port: 8080
8
    connection-timeout: 5000
8 9
    context-path: /renren-fast
9 10
10 11
spring: