diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 41c9d56..9af29ae 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -81,3 +81,31 @@ jobs: run: | make POEDITOR_API_ACCESS="${POEDITOR_API_ACCESS}" POEDITOR_PROJECT_ID="306433" build twine upload dist/* + docker: + name: Push to DockerHub + runs-on: ubuntu-latest + steps: + - + name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - + name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Build and push + id: docker_build + uses: docker/build-push-action@v2 + with: + push: true + file: ./Dockerfile + platforms: linux/amd64,linux/arm64,linux/386 + tags: kosmorro/kosmorro:latest + - + name: Image digest + run: echo ${{ steps.docker_build.outputs.digest }} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3f8450a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,27 @@ +FROM python:3.9-slim + +RUN useradd --create-home --shell /bin/bash kosmorro + +WORKDIR /home/kosmorro + +ENV PATH="/home/kosmorro:${PATH}" + +RUN python -m pip install --upgrade pip + +RUN pip install pipenv + +COPY Pipfile.lock . + +RUN pipenv sync && pipenv run pip freeze > requirements.txt + +RUN pip uninstall pipenv -y + +RUN pip install -r requirements.txt + +COPY kosmorrolib/ kosmorrolib/ + +COPY kosmorro . + +USER kosmorro + +CMD ["bash"] diff --git a/README.md b/README.md index 0a7bf3d..3a85f04 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,15 @@ Now, you can install Kosmorro with your PIP: `pip3 install kosmorro`. Kosmorro being at an early-stage development, Windows is not supported officially for now. +#### Docker + +Get the official Kosmorro Docker image by running `docker pull kosmorro/kosmorro`. + +Now that you have the image, you can run it with `docker run -it kosmorro`. +Run Kosmorro by executing `kosmorro` in the container. + +You can also run the image with the command: `docker run kosmorro kosmorro [args]`. + ### Development environment Before you run Kosmorro in your development environment, check you have installed these programs on your system: