Skip to content

Commit 66597ce

Browse files
author
Eran Davidovich
committed
feat: Add Dockerfile and Github Action.
This will allow CI for creating Docker images on push. Should be changed from push to pull_request once we feel more comfortable with the solution.
1 parent b42ad74 commit 66597ce

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

.github/workflows/docker-image.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Build Docker image
2+
3+
on: [push]
4+
5+
jobs:
6+
docker:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout
10+
uses: actions/checkout@v2
11+
12+
- name: Set up Docker Buildx
13+
uses: docker/setup-buildx-action@v1
14+
15+
- name: Login to DockerHub
16+
uses: docker/login-action@v1
17+
with:
18+
username: ${{ secrets.DOCKERHUB_USERNAME }}
19+
password: ${{ secrets.DOCKERHUB_TOKEN }}
20+
21+
- name: Build and push
22+
id: docker_build
23+
uses: docker/build-push-action@v2
24+
with:
25+
platforms: linux/amd64
26+
push: true
27+
tags: ${{ secrets.DOCKERHUB_USERNAME }}/pyth-client-py:{{ git_sha }} # should be tagged latest later on
28+
29+
- name: Image digest
30+
run: echo ${{ steps.docker_build.outputs.digest }}

Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# syntax=docker/dockerfile:1.2
2+
3+
FROM python:3.8-alpine
4+
5+
WORKDIR /app
6+
7+
COPY . .
8+
9+
RUN pip3 install --no-cache-dir -r requirements.txt && \
10+
python setup.py install

0 commit comments

Comments
 (0)