diff --git a/.dockerignore b/.dockerignore index b78d046..ad08e88 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,6 +1,10 @@ +.github .idea +.jenkins .git -__pycache__ +.venv +.vscode +**/__pycache__ service.json build docs diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 68e8c6a..dd65dca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -117,6 +117,34 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./public + package: + + runs-on: ubuntu-latest + needs: [build] # for ignoring bad builds + if: github.event_name == 'push' && github.ref == 'refs/heads/master' + + steps: + - uses: actions/checkout@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build & Push Container + uses: docker/build-push-action@v2 + with: + push: true + platforms: linux/amd64,linux/arm64 + tags: sarsoo/mixonomer:latest + deploy: runs-on: ubuntu-latest needs: build # for ignoring bad builds diff --git a/Dockerfile b/Dockerfile index c14f929..eae0c0b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:19 AS js-build +FROM node:19-alpine AS js-build RUN npm install -g sass @@ -14,7 +14,7 @@ RUN npm ci RUN npm run build --if-present RUN sass src/scss/style.scss build/style.css -FROM python:3.10 as py +FROM python:3.10-slim as py RUN pip install poetry RUN poetry config virtualenvs.create false @@ -27,7 +27,8 @@ COPY poetry.lock . RUN poetry install RUN poetry add gunicorn -COPY . ./ +COPY ./music ./music +COPY gunicorn.conf.py gunicorn.conf.py COPY main.api.py main.py COPY --from=js-build /mixonomer/build ./build/