diff --git a/.devcontainer/ansible/roles/setup-container/tasks/ssh.yml b/.devcontainer/ansible/roles/setup-container/tasks/ssh.yml index 06776a7..7069df8 100644 --- a/.devcontainer/ansible/roles/setup-container/tasks/ssh.yml +++ b/.devcontainer/ansible/roles/setup-container/tasks/ssh.yml @@ -1,20 +1,23 @@ -- name: et permissions on ~/.ssh +- name: Set permissions on ~/.ssh file: - path: "{{ lookup('env', 'HOME') + '/.ssh' }}" + path: "'~/.ssh' }}" state: directory owner: "{{ lookup('env', 'USER') }}" group: "{{ lookup('env', 'USER') }}" recurse: true mode: '0700' + become: true - name: Set permissions for ~/.ssh files + file: path: "{{ item }}" mode: '0600' owner: "{{ lookup('env', 'USER') }}" group: "{{ lookup('env', 'USER') }}" + become: true with_fileglob: - - "{{ lookup('env', 'HOME') }}/.ssh/*" + - "~/.ssh/*" - name: Setup and start ssh-agent shell: | diff --git a/.devcontainer/ansible/setup-container.yml b/.devcontainer/ansible/setup-container.yml index 523dc39..32d7b7d 100644 --- a/.devcontainer/ansible/setup-container.yml +++ b/.devcontainer/ansible/setup-container.yml @@ -3,16 +3,6 @@ hosts: localhost connection: local gather_facts: true - vars: - # docker defaults - docker_edition: 'ce' - docker_package_state: present - docker_service_manage: false - docker_install_compose_plugin: true - docker_compose_package: docker-compose-plugin - docker_compose_package_state: present - - docker_users: - - "{{ lookup('env', 'USER') }}" + ignore_errors: true roles: - role: setup-container \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 60576bb..ea61c08 100755 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -51,22 +51,10 @@ "ms-python.isort" ], "settings": { - "[python]": { - "editor.defaultFormatter": "ms-python.black-formatter", - "editor.detectIndentation": false, - "editor.insertSpaces": false, - "editor.tabSize": 2 - }, - "files.exclude": { - "**/.dotnet": true, - "**/.zcompdump": true - }, "dev.containers.copyGitConfig": false, "dev.containers.gitCredentialHelperConfigLocation": "system", - "editor.tabSize": 2, "files.readonlyFromPermissions": true, "python.analysis.extraPaths": [ "${containerWorkspaceFolder}/app" ], - "terminal.external.windowsExec": "C:\\Program Files\\PowerShell\\7\\pwsh.exe", "terminal.integrated.defaultProfile.linux": "zsh", "terminal.integrated.defaultProfile.windows": "pwsh", "terminal.integrated.profiles.linux": { @@ -88,7 +76,7 @@ }, "terminal.integrated.tabs.description": "", "terminal.integrated.tabs.title": "${local}${separator}${cwdFolder}${separator}${process}", - "window.title": "${localWorkspaceFolderBasename}" + "window.title": "${localWorkspaceFolderBasename} ${process}" } } } diff --git a/Dockerfile b/Dockerfile index 1191c72..3294e57 100755 --- a/Dockerfile +++ b/Dockerfile @@ -169,6 +169,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ echo ${USER} ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/${USER} && \ chmod 0440 /etc/sudoers.d/${USER} +COPY .devcontainer .devcontainer + +RUN LC_ALL=C.UTF-8 ansible-playbook --inventory 127.0.0.1 --connection=local .devcontainer/ansible/requirements.yml && \ + LC_ALL=C.UTF-8 ansible-playbook --inventory 127.0.0.1 --connection=local .devcontainer/ansible/install-docker.yml + RUN apt-get update && apt-get install -y --no-install-recommends \ graphviz \ imagemagick \ @@ -192,9 +197,6 @@ RUN pip3 install --no-cache-dir --target=${PYTHON_DEPS_PATH} --no-deps --prefer- RUN pip3 install --no-cache-dir --target=${PYTHON_DEPS_PATH} --prefer-binary pandas-datareader bottleneck scipy duckdb sqlalchemy pyautogui requests_cache statsmodels #RUN pip3 install --no-cache-dir --target=${PYTHON_DEPS_PATH} gensim torch tensorflow -RUN LC_ALL=C.UTF-8 ansible-playbook --inventory 127.0.0.1 --connection=local .devcontainer/ansible/requirements.yml && \ - LC_ALL=C.UTF-8 ansible-playbook --inventory 127.0.0.1 --connection=local .devcontainer/ansible/install-docker.yml - USER ${USER} # https://code.visualstudio.com/remote/advancedcontainers/start-processes#_adding-startup-commands-to-the-docker-image-instead