forked from FlowCI/flow-core-x
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
58 lines (45 loc) · 1.62 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#
# Flow Platform Dockerfile
# Image Name: flowci/flow-platform
#
# https://github.com/FlowCI/flow-platform
#
FROM flowci/flow-platform-base:latest
# setup flow.ci default environments
ENV FLOW_PLATFORM_DIR=/etc/flow.ci
ENV FLOW_PLATFORM_CONFIG_DIR=/etc/flow.ci/config
ENV FLOW_PLATFORM_SOURCE_CODE=/flow-platform
ENV MVN_CACHE=/root/.m2
# setup mysql config
ADD ./docker/mysqld.cnf /etc/mysql/conf.d/mysqld.cnf
VOLUME /var/lib/mysql
# mount docker
# docker in docker volume map happens some error
# VOLUME /var/lib/docker
COPY ./docker/daemon.json /etc/docker/daemon.json
# config tomcat
COPY ./docker/tomcat-users.xml $CATALINA_HOME/conf
# copy code
COPY . $FLOW_PLATFORM_SOURCE_CODE
# mvn build and set wars to tomcat and delete no use thing
RUN cd $FLOW_PLATFORM_SOURCE_CODE \
&& rm -rf $FLOW_PLATFORM_SOURCE_CODE/dist \
&& mvn clean install -DskipTests=true \
&& mkdir -p $FLOW_PLATFORM_CONFIG_DIR \
&& cd $FLOW_PLATFORM_SOURCE_CODE \
&& mv ./dist/flow-control-center-*.war $CATALINA_HOME/webapps/flow-control-center.war \
&& mv ./dist/flow-api-*.war $CATALINA_HOME/webapps/flow-api.war \
&& rm -rf $FLOW_PLATFORM_SOURCE_CODE \
&& rm -rf $MVN_CACHE
# add aliyun proxy
ADD ./docker/settings.xml /root/.m2/
# cache mvn package
VOLUME /root/.m2/repository
# setup flow.ci default configuration
COPY ./docker/app-cc.properties $FLOW_PLATFORM_CONFIG_DIR
COPY ./docker/app-api.properties $FLOW_PLATFORM_CONFIG_DIR
# wait for mysql
COPY ./docker/flow.ci.backend.cmd.sh $FLOW_PLATFORM_DIR
COPY ./schema/migration $FLOW_PLATFORM_DIR/migration
WORKDIR $FLOW_PLATFORM_DIR
CMD bash ./flow.ci.backend.cmd.sh catalina.sh run