Skip to content

Commit

Permalink
Merge pull request #157 from ConnectAI-E/add-docker-CI
Browse files Browse the repository at this point in the history
Create docker-image.yml
  • Loading branch information
freeziyou authored Jan 29, 2024
2 parents 67d34e2 + bfdaaa4 commit d45c6f2
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 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" ]
pull_request:
branches: [ "main" ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Check out the repo
uses: actions/checkout@v2

- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_ACCOUNT }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
file: Dockerfile
push: true
tags: connectai/gitmaya:latest
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM python:3.10-slim-bookworm

RUN sed -i "s@http://deb.debian.org@http://mirrors.aliyun.com@g" /etc/apt/sources.list.d/debian.sources
RUN ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

ADD ./requirements.txt /tmp/requirements.txt

RUN apt-get update && apt-get install -y libcurl4-openssl-dev libffi-dev libxml2-dev libmariadb-dev\
&& pip install -r /tmp/requirements.txt && pip install gunicorn gevent

ADD ./deploy/wait-for-it.sh /wait-for-it.sh
ADD ./deploy/entrypoint.sh /entrypoint.sh

ADD ./server /server

WORKDIR /server

ENTRYPOINT ["/entrypoint.sh"]

CMD ["gunicorn", "--worker-class=gevent", "--workers", "1", "--bind", "0.0.0.0:8888", "-t", "600", "--keep-alive", "60", "--log-level=info", "server:app"]

0 comments on commit d45c6f2

Please sign in to comment.