From bcd486561f8299069b1844dfb54bc60351e93ffb Mon Sep 17 00:00:00 2001 From: James Woglom Date: Wed, 20 Oct 2021 01:01:47 -0400 Subject: [PATCH] dockerfile: fix build --- .github/workflows/publish-pypi.yml | 5 ++--- Dockerfile | 8 +++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index b1fd6d0..f447416 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -4,8 +4,8 @@ on: branches: [ master ] jobs: - publish-pypi: - name: Publish to PyPI + build-binary: + name: Build Binary and Publish to PyPI runs-on: ubuntu-latest steps: @@ -30,7 +30,6 @@ jobs: --outdir dist/ . - name: Publish to PyPI - if: startsWith(github.ref, 'refs/tags') uses: pypa/gh-action-pypi-publish@master with: password: ${{ secrets.PYPI_API_TOKEN }} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 89c3160..190a6f8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,20 +15,22 @@ FROM base AS python-deps RUN pip install pipenv RUN apt-get update && apt-get install -y --no-install-recommends gcc +RUN mkdir -p /base +WORKDIR /base + # Install python dependencies in /.venv COPY Pipfile . COPY Pipfile.lock . COPY setup.cfg . COPY setup.py . COPY pyproject.toml . -COPY tconnectsync . RUN PIPENV_VENV_IN_PROJECT=1 pipenv install --deploy FROM base AS runtime # Copy virtualenv from python-deps stage -COPY --from=python-deps /.venv /.venv -ENV PATH="/.venv/bin:$PATH" +COPY --from=python-deps /base/.venv /base/.venv +ENV PATH="/base/.venv/bin:$PATH" # Create and switch to a new user RUN useradd --create-home appuser