service.mercury: # set Mercury Parser API endpoint to `service.mercury:3000` on TTRSS plugin setting page image: wangqiru/mercury-parser-api:latest container_name: mercury networks: - public_access - service_only
service.opencc: # set OpenCC API endpoint to `service.opencc:3000` on TTRSS plugin setting page image: wangqiru/opencc-api-server:latest container_name: opencc environment: - NODE_ENV=production networks: - service_only
database.postgres: image: postgres:13-alpine container_name: postgres environment: - POSTGRES_PASSWORD=AAAAAAAAAA # feel free to change the password volumes: - ttrss_postgres:/var/lib/postgresql/data # persist postgres data to ~/postgres/data/ on the host networks: - database_only
volumes: feed-icons: ttrss_postgres:
networks: public_access: # Provide the access for ttrss UI service_only: # Provide the communication network between services only internal: true database_only: # Provide the communication between ttrss and database only internal: true
COPY . /workdir WORKDIR /workdir RUN ls RUN npm install -g cnpm --registry=https://registry.npm.taobao.org RUN cnpm -v RUN cnpm i yarn tyarn -g RUN tyarn -v RUN tyarn RUN tyarn docs:build
# 选择更小体积的基础镜像 FROM nginx:alpine COPY --from=builder /workdir/docs/.vuepress/dist /usr/share/nginx/html
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ b# 清华 deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic main restricted universe multiverse deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-security main restricted universe multiverse deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-updates main restricted universe multiverse deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-proposed main restricted universe multiverse deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-backports main restricted universe multiverse deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic main restricted universe multiverse deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-security main restricted universe multiverse deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-updates main restricted universe multiverse deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-proposed main restricted universe multiverse deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-backports main restricted universe multiverse
[Unit] Description=V2Ray Service After=network.target Wants=network.target
[Service] # This service runs as root. You may consider to run it as another user for security concerns. # By uncommenting the following two lines, this service will run as user v2ray/v2ray. # More discussion at https://github.com/v2ray/v2ray-core/issues/1011 # User=v2ray # Group=v2ray Type=simple PIDFile=/run/v2ray.pid ExecStart=/usr/bin/v2ray/v2ray -config /etc/v2ray/config.json Restart=on-failure # Don't restart in the case of configuration error RestartPreventExitStatus=23
constsquare = p => { console.log(p) return p * p }
只包含一个表达式
const square = p => p * p
Object methods and “this”
使用箭头函数可以解决与 this相关的一系列问题
Classes
1 2 3 4 5 6 7 8 9 10 11
classPerson { constructor(name, age) { this.name = name this.age = age } greet() { console.log('hello, my name is ' + this.name) } } const adam = newPerson('Adam Ondra', 35) adam.greet()
Destructuring (解构)
1 2 3 4 5 6 7 8 9 10
constHello = ({ name, age }) => { constbornYear = () => newDate().getFullYear() - age return ( <div> <p> Hello {name}, you are {age} years old </p> <p>So you were probably born in {bornYear()}</p> </div> ) }
constHello = (props) => { constbornYear = () => { const yearNow = newDate().getFullYear() return yearNow - props.age } return ( <div> <p> Hello {props.name}, you are {props.age} years old </p> <p>So you were probably born in {bornYear()}</p></div> ) }