Fix ansible deployment
This commit is contained in:
parent
07bf373097
commit
c353accdfb
2 changed files with 6 additions and 5 deletions
|
@ -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
|
||||
|
|
|
@ -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" ]
|
||||
|
|
Loading…
Reference in a new issue