Skip to content

Commit

Permalink
build: update docker image ci
Browse files Browse the repository at this point in the history
  • Loading branch information
VGalaxies committed Feb 16, 2023
1 parent 00abfa5 commit ade4219
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 9 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Docker Image CI

on:
push:
branches:
- 'main'

jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v4
with:
push: true
tags: vgalaxy/mini-tiktok:latest
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ WORKDIR /root
COPY --from=build /root .
COPY --from=script /root/wait.sh ./wait.sh
COPY --from=script /root/configs ./configs
COPY logs logs
COPY scripts/wait.sh wait.sh
RUN sed -i "s@http://\(deb\|security\).debian.org@https://mirrors.tuna.tsinghua.edu.cn@g" /etc/apt/sources.list \
&& apt update \
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ test:
go test ./test/api_test.go ./test/common.go -v

kill:
docker kill $$(docker ps -a -q)
# `$` will be escaped
ps -ef | grep -E "(go run ./cmd)|(/tmp/go-build)" | grep -v "grep" | awk '{print $$2}' | xargs kill -9

service:
docker compose up mysql redis etcd otel-collector jaeger-all-in-one victoriametrics grafana minio
docker compose up -d mysql redis etcd otel-collector jaeger-all-in-one victoriametrics grafana minio

docker: logs
docker compose up -d --scale user-server=${USER_SERVER} \
Expand Down
14 changes: 7 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: "3.9"

services:
api-server:
image: heiyan2020/mini-tiktok:latest
image: vgalaxy/mini-tiktok:latest
network_mode: host
volumes:
- ./logs:/root/logs
Expand All @@ -12,7 +12,7 @@ services:
command: bash /root/wait.sh 3306 2379 4317 9000 6379 -- /root/cmd/api/output/api

user-server:
image: heiyan2020/mini-tiktok:latest
image: vgalaxy/mini-tiktok:latest
network_mode: host
volumes:
- ./logs:/root/logs
Expand All @@ -22,7 +22,7 @@ services:
command: bash /root/wait.sh 3306 2379 4317 9000 6379 -- /root/cmd/user/output/user

comment-server:
image: heiyan2020/mini-tiktok:latest
image: vgalaxy/mini-tiktok:latest
network_mode: host
volumes:
- ./logs:/root/logs
Expand All @@ -32,7 +32,7 @@ services:
command: bash /root/wait.sh 3306 2379 4317 9000 6379 -- /root/cmd/comment/output/comment

feed-server:
image: heiyan2020/mini-tiktok:latest
image: vgalaxy/mini-tiktok:latest
network_mode: host
volumes:
- ./logs:/root/logs
Expand All @@ -42,7 +42,7 @@ services:
command: bash /root/wait.sh 3306 2379 4317 9000 6379 -- /root/cmd/feed/output/feed

publish-server:
image: heiyan2020/mini-tiktok:latest
image: vgalaxy/mini-tiktok:latest
network_mode: host
volumes:
- ./logs:/root/logs
Expand All @@ -52,7 +52,7 @@ services:
command: bash /root/wait.sh 3306 2379 4317 9000 6379 -- /root/cmd/publish/output/publish

favorite-server:
image: heiyan2020/mini-tiktok:latest
image: vgalaxy/mini-tiktok:latest
network_mode: host
volumes:
- ./logs:/root/logs
Expand All @@ -62,7 +62,7 @@ services:
command: bash /root/wait.sh 3306 2379 4317 9000 6379 -- /root/cmd/favorite/output/favorite

relation-server:
image: heiyan2020/mini-tiktok:latest
image: vgalaxy/mini-tiktok:latest
network_mode: host
volumes:
- ./logs:/root/logs
Expand Down

0 comments on commit ade4219

Please sign in to comment.