diff --git a/ansible.yml b/ansible.yml index 2c62d0d..459d186 100644 --- a/ansible.yml +++ b/ansible.yml @@ -1,5 +1,6 @@ --- - hosts: all + become: yes # Install python if required # https://www.josharcher.uk/code/ansible-python-connection-failure-ubuntu-server-1604/ @@ -20,14 +21,14 @@ - name: copy all build files recursively copy: src={{ item.from }} dest={{ item.to }} with_items: - - { from: 'src/', to: '/tmp/communistquotes/src' } + - { from: 'src/', to: '/tmp/communistquotes/' } - { from: 'quotes/', to: '/tmp/communistquotes/quotes' } - name: Build image using cache source docker_image: name: communistquotes:latest build: - path: /tmp/communistquotes + path: /tmp/communistquotes/ pull: yes source: build force_source: yes diff --git a/src/Dockerfile b/src/Dockerfile index 166f23d..7d7af83 100644 --- a/src/Dockerfile +++ b/src/Dockerfile @@ -2,10 +2,10 @@ FROM python:3-alpine WORKDIR /usr/src/app -COPY src/requirements.txt ./ +COPY requirements.txt ./ RUN pip install --no-cache-dir -r requirements.txt -COPY src/*.py src/ +COPY main.py . COPY quotes/ quotes/ -ENTRYPOINT [ "python", "./src/main.py" ] +ENTRYPOINT [ "python", "./main.py" ]