docker方式

docker run -it --name phabricator_database -p 3306:3306 phabricator_database
docker run -it --name phabricator -p 9091:80 --link phabricator_database:database phabricator

k8s方式

pod

apiVersion: v1
kind: Pod
metadata:
  name: phabricator
  namespace: default
  labels: 
    name: phabricator
spec:
  restartPolicy: Never
  containers:
    - name: phabricator-web
      image: phabricator
      imagePullPolicy: Always
      ports:
        - containerPort: 80
       env:
         - name: database
           value: localhost

    - name: phabricator-database
      image:  phabricator_database
      imagePullPolicy: Always
      ports:
        - containerPort: 3306

svc

apiVersion: v1
kind: Service
metadata: 
  namespace: default
  name: phabricator-service
  labels: 
    name: phabricator
spec: 
  type: NodePort
  ports:
    # the port that this service should serve on
    - port: 80
      nodePort: 31000
  # label keys and values that must match in order to receive traffic for this service
  selector: 
    name: phabricator

codecraft
11.9k 声望2k 粉丝

当一个代码的工匠回首往事时,不因虚度年华而悔恨,也不因碌碌无为而羞愧,这样,当他老的时候,可以很自豪告诉世人,我曾经将代码注入生命去打造互联网的浪潮之巅,那是个很疯狂的时代,我在一波波的浪潮上留下...