Skip to content

Commit

Permalink
feat: add CI for alpine docker image (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
gxthrj authored Aug 31, 2020
1 parent 6ac41f4 commit 86968b3
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 5 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/linux_alpine_ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Docker compose CI on linux

on:
push:
branches: [ master, kv/alpine ]
pull_request:
branches: [ master ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: use docker-compose
run: cd ./example && sh gen-config-yaml.sh && docker-compose -f docker-compose-alpine.yml -p docker-apisix up -d
2 changes: 1 addition & 1 deletion .github/workflows/linux_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: use docker-compose
run: cd ./example && docker-compose -p docker-apisix up -d
run: cd ./example && sh gen-config-yaml.sh && docker-compose -p docker-apisix up -d
4 changes: 1 addition & 3 deletions example/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
### Run

```
$ chmod +x gen-config-yaml.sh
$ sh gen-config-yaml.sh
$ docker-compose -p docker-apisix up -d
$ sh gen-config-yaml.sh && docker-compose -p docker-apisix up -d
```

### Configure
Expand Down
66 changes: 66 additions & 0 deletions example/docker-compose-alpine.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
version: "3"

services:
apisix:
build:
context: ./..
dockerfile: alpine/Dockerfile
args:
APISIX_VERSION: master
restart: always
volumes:
- ./apisix_log:/usr/local/apisix/logs
- ./apisix_conf/config.yaml:/usr/local/apisix/conf/config.yaml:ro
depends_on:
- etcd
ports:
- "9080:9080/tcp"
- "9443:9443/tcp"
networks:
apisix:
ipv4_address: 172.18.5.11

etcd:
image: bitnami/etcd:3.4.9
user: root
restart: always
volumes:
- ./etcd_data:/etcd_data
environment:
ETCD_DATA_DIR: /etcd_data
ETCD_ENABLE_V2: "true"
ALLOW_NONE_AUTHENTICATION: "yes"
ETCD_ADVERTISE_CLIENT_URLS: "http://0.0.0.0:2379"
ETCD_LISTEN_CLIENT_URLS: "http://0.0.0.0:2379"
ports:
- "2379:2379/tcp"
networks:
apisix:
ipv4_address: 172.18.5.10

web1:
image: ruby:2-alpine
command: sh -c "mkdir -p /tmp/www && echo 'web1' > /tmp/www/web1.txt && ruby -run -ehttpd /tmp/www -p8000"
restart: always
ports:
- "9081:8000/tcp"
networks:
apisix:
ipv4_address: 172.18.5.12

web2:
image: ruby:2-alpine
command: sh -c "mkdir -p /tmp/www && echo 'web2' > /tmp/www/web2.txt && ruby -run -ehttpd /tmp/www -p8000"
restart: always
ports:
- "9082:8000/tcp"
networks:
apisix:
ipv4_address: 172.18.5.13

networks:
apisix:
driver: bridge
ipam:
config:
- subnet: 172.18.0.0/16
1 change: 1 addition & 0 deletions example/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
version: "3"

services:

apisix:
build:
context: ./..
Expand Down
2 changes: 1 addition & 1 deletion example/gen-config-yaml.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

export etcd_url='http://172.18.5.10:2379'
export etcd_url='http://etcd:2379'

wget https://raw.githubusercontent.com/apache/apisix/master/conf/config-default.yaml -O config.yaml

Expand Down

0 comments on commit 86968b3

Please sign in to comment.