mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-07-31 10:19:54 +03:00
debug-ready welcome message
This commit is contained in:
parent
43098a4cfb
commit
7ec4a20f5e
|
@ -3,7 +3,7 @@
|
|||
<component name="WebServers">
|
||||
<option name="servers">
|
||||
<webServer id="ce16d0a1-6207-4682-89cf-b5cca576c85c" name="docker_{{ cookiecutter.repo_name }}" url="http://localhost">
|
||||
<fileTransfer host="localhost" port="2222" privateKey="$PROJECT_DIR$/compose/pycharm/.ssh_keys_to_docker/id_rsa" accessType="SFTP" username="docker_{{ cookiecutter.repo_name }}" keyPair="true">
|
||||
<fileTransfer host="localhost" port="2222" privateKey="$PROJECT_DIR$/compose/debug/keys_to_docker/id_rsa" accessType="SFTP" username="docker_{{ cookiecutter.repo_name }}" keyPair="true">
|
||||
<advancedOptions>
|
||||
<advancedOptions dataProtectionLevel="Private" />
|
||||
</advancedOptions>
|
||||
|
|
|
@ -1,16 +1,15 @@
|
|||
#!/bin/bash
|
||||
|
||||
/app/compose/django/entrypoint.sh echo
|
||||
/app/compose/django/entrypoint.sh :
|
||||
|
||||
USER=docker_{{ cookiecutter.repo_name }}
|
||||
|
||||
# rename django username to docker_{{ cookiecutter.repo_name }}
|
||||
usermod -l $USER django
|
||||
usermod -l $USER -m -d /home/new_username django
|
||||
usermod -l $USER -m -d /home/$USER django
|
||||
groupmod -n $USER django
|
||||
|
||||
mkdir /home/$USER/.ssh
|
||||
cat /app/compose/debug/keys_to_docker/ssh_id_rsa.pub > /home/$USER/.ssh/authorized_keys
|
||||
cat /app/compose/debug/keys_to_docker/id_rsa.pub > /home/$USER/.ssh/authorized_keys
|
||||
|
||||
chmod 755 /home/$USER
|
||||
chmod 700 /home/$USER/.ssh
|
||||
|
@ -19,7 +18,8 @@ chown -R $USER:$USER /home/$USER
|
|||
|
||||
echo "$USER:docker" | chpasswd
|
||||
|
||||
# starting ssh (detached)
|
||||
exec /etc/init.d/ssh start &
|
||||
service ssh start
|
||||
|
||||
su -c 'python -c "import signal; signal.pause()"' $USER
|
||||
cat /app/compose/debug/welcome_msg
|
||||
|
||||
sleep infinity
|
||||
|
|
12
{{cookiecutter.repo_name}}/compose/debug/welcome_msg
Normal file
12
{{cookiecutter.repo_name}}/compose/debug/welcome_msg
Normal file
|
@ -0,0 +1,12 @@
|
|||
|
||||
You can now debug your project remotly using ssh connection:
|
||||
|
||||
User: docker_light
|
||||
Password: docker
|
||||
|
||||
You can also login without password, using debug-only ssh key:
|
||||
|
||||
$ ssh -i compose/debug/keys_to_docker/id_rsa docker_{{ cookiecutter.repo_name }}@localhost -p 2222
|
||||
|
||||
Read more about remote debugging with various IDE (PyCharm, etc) in docs/docker_remote_debugging.rst
|
||||
|
Loading…
Reference in New Issue
Block a user