Skip to content

Commit

Permalink
docker
Browse files Browse the repository at this point in the history
  • Loading branch information
milinsoft committed May 12, 2024
1 parent ec38362 commit 77c7b9b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
uses: actions/checkout@v4
- name: Build Docker Image
run: |
docker build -t test-tag .
docker build -t test-tag --build-arg="branch={{ github.head_ref }}" .
working-directory: ${{ env.DOCKERFILE_DIRECTORY }}
- name: TEST VIA DOCKER
run: docker run test-tag
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
FROM alpine

ARG branch
ARG branch=main
ENV GIT_REPO_URL=https://github.com/milinsoft/bank_app
ENV PROJECT_FOLDER=/app/bank_app

WORKDIR /app

RUN set -ex \
&& apk add --update --no-cache git python3 py3-pip \
&& git clone $GIT_REPO_URL $PROJECT_FOLDER -b refactor-workflow --depth=1 \
&& git clone $GIT_REPO_URL $PROJECT_FOLDER $branch --depth=1 \
&& python3 -m venv venv \
&& chmod +x ./venv/bin/activate \
&& ./venv/bin/pip install -r $PROJECT_FOLDER/requirements.txt \
&& ln -sf /venv/bin/python /usr/bin/python \
&& apk del git \
&& rm -rf /var/cache/apk/* /root/.cache $PROJECT_FOLDER/.git

# FIXME: Fix command in the final version
CMD ["python", "-m", "unittest", "discover", "bank_app"]

0 comments on commit 77c7b9b

Please sign in to comment.