Commit a7b580fe authored by nanahira's avatar nanahira

add sftp things

parent 358e95bb
...@@ -76,19 +76,26 @@ ...@@ -76,19 +76,26 @@
owner: 1000 owner: 1000
group: 1000 group: 1000
with_items: '{{instances}}' with_items: '{{instances}}'
- name: sftp user file
copy:
content: |
{% for instance in instances %}
{{instance.name}}:{{instance.password}}:1000:1000
{% endfor %}
dest: '{{jupyter_root}}/sftp_users.conf'
- name: docker-compose up -d - name: docker-compose up -d
docker_compose: docker_compose:
project_src: '{{ jupyter_root }}' project_src: '{{ jupyter_root }}'
remove_orphans: true remove_orphans: true
pull: true pull: true
handlers: handlers:
- name: restart_nginx - name: restart_all
docker_compose: docker_compose:
project_src: '{{ jupyter_root }}' project_src: '{{ jupyter_root }}'
services:
- nginx
restarted: true restarted: true
- name: restart_all - name: restart_nginx
docker_compose: docker_compose:
project_src: '{{ jupyter_root }}' project_src: '{{ jupyter_root }}'
services:
- nginx
restarted: true restarted: true
...@@ -12,8 +12,25 @@ services: ...@@ -12,8 +12,25 @@ services:
- ./certs:/etc/nginx/certs:ro - ./certs:/etc/nginx/certs:ro
- ./nginx/cache:/etc/nginx/cache - ./nginx/cache:/etc/nginx/cache
- ./nginx/log:/var/log/nginx - ./nginx/log:/var/log/nginx
sftp:
restart: always
image: atmoz/sftp
ports:
- '7322:22'
volumes:
- ./sftp_users.conf:/etc/sftp/users.conf:ro
- /etc/ssh/ssh_host_rsa_key:/etc/ssh/ssh_host_rsa_key:ro
- /etc/ssh/ssh_host_dsa_key:/etc/ssh/ssh_host_dsa_key:ro
- /etc/ssh/ssh_host_ecdsa_key:/etc/ssh/ssh_host_ecdsa_key:ro
- /etc/ssh/ssh_host_ed25519_key:/etc/ssh/ssh_host_ed25519_key:ro
{% for instance in instances %}
- ./attachments:/home/{{ instance.name }}/attachments:ro
- ./instances/data/{{ instance.name }}:/home/{{ instance.name }}/work
{% endfor %}
# instances
{% for instance in instances %} {% for instance in instances %}
'{{instance.name}}': 'notebook_instance_{{instance.name}}':
restart: always restart: always
image: {{ jupyter_image }} image: {{ jupyter_image }}
cpus: 1 cpus: 1
......
...@@ -14,6 +14,6 @@ server { ...@@ -14,6 +14,6 @@ server {
proxy_http_version 1.1; proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade; proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade; proxy_set_header Connection $connection_upgrade;
proxy_pass http://$1:8888; proxy_pass http://notebook_instance_$1:8888;
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment