Skip to content

Commit

Permalink
added docker file for deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
Mole1424 committed Sep 16, 2024
1 parent b4dd564 commit 864f2af
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 1 deletion.
49 changes: 49 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: CI # the name of our workflow is 'CI'

# run this workflow when we push to the 'main' branch
on:
push:
branches: [main]

# the list of jobs in this workflow
jobs:

# define a job
build:
name: Build and Push Container Image # the job's full name
runs-on: ubuntu-latest # the OS that this job runs on

# we need write permissions to publish the package
permissions:
packages: write

# the steps that this job consists of
steps:
- name: Checkout # check out our repo
uses: actions/checkout@v3

- name: Log in to the container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

# generate the tags that we'll use to name our image
- name: Get Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository }}
tags: | # tag with commit hash and with 'latest'
type=sha
type=raw,value=latest,enable={{is_default_branch}}
# build and push our image, using output from previous step
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM python:3.10
RUN pip install pipenv
WORKDIR /app
COPY . .
RUN pipenv install --system
CMD gunicorn app:app -b 0.0.0.0:8080
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ name = "pypi"
[packages]
flask = "*"
markdown = "*"
gunicorn = "*"

[dev-packages]

Expand Down
18 changes: 17 additions & 1 deletion Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 864f2af

Please sign in to comment.