commented back in the 'USER: nonroot' line in the Dockerfile now that pushing to a server thru an ansible playbook has rendered all local WSL-2 considerations a nonissue; updated said deploy-playbook.yaml with new tasks to build out real docker container on server
This commit is contained in:
@@ -15,6 +15,6 @@ RUN python manage.py collectstatic
|
|||||||
ENV DJANGO_DEBUG_FALSE=1
|
ENV DJANGO_DEBUG_FALSE=1
|
||||||
|
|
||||||
RUN adduser --uid 1234 nonroot
|
RUN adduser --uid 1234 nonroot
|
||||||
# USER nonroot
|
USER nonroot
|
||||||
|
|
||||||
CMD ["gunicorn", "--bind", ":8888", "core.wsgi:application"]
|
CMD ["gunicorn", "--bind", ":8888", "core.wsgi:application"]
|
||||||
@@ -18,9 +18,29 @@
|
|||||||
- name: Reset ssh connection to allow the user/group change to take effect
|
- name: Reset ssh connection to allow the user/group change to take effect
|
||||||
ansible.builtin.meta: reset_connection
|
ansible.builtin.meta: reset_connection
|
||||||
|
|
||||||
- name: Run test container
|
- name: Export container image locally
|
||||||
|
community.docker.docker_image:
|
||||||
|
name: gamearray
|
||||||
|
archive_path: /tmp/gamearray-img.tar
|
||||||
|
source: local
|
||||||
|
delegate_to: 127.0.0.1
|
||||||
|
|
||||||
|
- name: Upload image to server
|
||||||
|
ansible.builtin.copy:
|
||||||
|
src: /tmp/gamearray-img.tar
|
||||||
|
dest: /tmp/gamearray-img.tar
|
||||||
|
|
||||||
|
- name: Import container image on server
|
||||||
|
community.docker.docker_image:
|
||||||
|
name: gamearray
|
||||||
|
load_path: /tmp/gamearray-img.tar
|
||||||
|
source: load
|
||||||
|
force_source: true
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: Run container
|
||||||
community.docker.docker_container:
|
community.docker.docker_container:
|
||||||
name: testcontainer
|
name: gamearray
|
||||||
|
image: gamearray
|
||||||
state: started
|
state: started
|
||||||
image: busybox
|
recreate: true
|
||||||
command: echo howdy partner
|
|
||||||
Reference in New Issue
Block a user