Repository navigation
Container action #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Container action #26
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| on: | ||
| workflow_dispatch: | ||
| push: | ||
| branches: | ||
| - main | ||
| # paths: | ||
| # - 'Dockerfile' | ||
| # - '.github/workflows/push.yml' | ||
|
|
||
| name: Push docker image to ghcr.io | ||
|
|
||
| jobs: | ||
| push: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - | ||
| name: Checkout | ||
| uses: actions/checkout@v3 | ||
| - | ||
| name: Docker meta | ||
| id: meta | ||
| uses: docker/metadata-action@v4 | ||
| with: | ||
| images: | | ||
| ghcr.io/${{ github.repository }} | ||
| tags: | | ||
| type=raw,value=1.0.${{ github.run_number }},priority=1000 | ||
| type=ref,event=branch | ||
| type=sha | ||
| type=raw,value=latest | ||
| - | ||
| name: Set up QEMU | ||
| uses: docker/setup-qemu-action@v2 | ||
| - | ||
| name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v2 | ||
| - | ||
| name: Login to Container Registry | ||
| uses: docker/login-action@v2 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.repository_owner }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
| - | ||
| name: Docker build and push | ||
| uses: docker/build-push-action@v3 | ||
| with: | ||
| context: . | ||
| file: Dockerfile | ||
| tags: ${{ steps.meta.outputs.tags }} | ||
| labels: ${{ steps.meta.outputs.labels }} | ||
| push: true | ||
| cache-from: type=gha | ||
| cache-to: type=gha,mode=max |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,30 @@ | ||
| # syntax=docker/dockerfile:1.4 | ||
| FROM python:3.7-slim-buster as builder | ||
| RUN apt-get update | ||
| RUN apt-get install -y libpq-dev python3-dev libsystemd-dev build-essential pkg-config | ||
| RUN apt-get update && apt-get install -y \ | ||
| libpq-dev python3-dev libsystemd-dev build-essential pkg-config | ||
| COPY ./ ./ | ||
| RUN python -m pip wheel -w wheelhouse . | ||
|
|
||
| FROM python:3.7-slim-buster | ||
| RUN apt-get update | ||
| RUN apt-get -y install libpq5 | ||
|
|
||
| ENV PYTHONUNBUFFERED=1 | ||
| ENV TZ=UTC | ||
| ENV DEBIAN_FRONTEND=noninteractive | ||
| RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone | ||
|
|
||
| ENV TINI_VERSION="v0.19.0" | ||
| ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini | ||
| RUN chmod +x /tini | ||
|
|
||
| RUN apt-get update && apt-get -y install libpq5 | ||
| COPY --from=builder wheelhouse wheelhouse | ||
| RUN python -m pip --no-cache-dir install csvbase --no-index -f wheelhouse | ||
|
|
||
| ENV FLASK_APP=csvbase.web:init_app() | ||
| ENV FLASK_ENV=production | ||
|
|
||
| EXPOSE 6001 | ||
|
|
||
| ENTRYPOINT ["/tini", "--"] | ||
| CMD ["gunicorn", "csvbase.web:init_app()", "-b", ":6001"] | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks to me this is now built-in to docker but happy to include it as that makes it the default