Enable SSH on Backend-Server
I recently migrated to Azure and would like to enable SSH to connect to the docker container for troubleshooting in case something goes wrong. I found this Guide on how to set this up: https://learn.microsoft.com/en-gb/azure/app-service/configure-custom-container?tabs=debian&pivots=container-linux#enable-ssh
It needs me to add an sshd_config file on root level (i guess i would do this by
cpy
during build) and also modify the Dockerfile which is created during Build. I guess there is no way for me to modify this file without writing a script which manually inserts parts on specific lines. Any advice on this?Configure a custom container - Azure App Service
Learn how to configure a custom container in Azure App Service. This article shows the most common configuration tasks.
2 Replies
Hi @Gwaggli. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
In Wasp, you can customize the Dockerfile that is generated during the build process. You can add extra steps to this Dockerfile by creating your own Dockerfile in the project's root directory. If Wasp finds a Dockerfile in the project's root, it appends its contents at the bottom of the default Dockerfile. Since the last definition in a Dockerfile wins, you can override or continue from any existing build stages.
To add the sshd_config file, you can use the
COPY
command in your Dockerfile to copy the file from your project's root into the Docker container during the build process.
Here is an example of how you might modify your Dockerfile:
Remember to supply ENTRYPOINT
in your final build stage. Your changes won't have any effect if you don't.
To see what your project's (potentially combined) Dockerfile will look like, you can run the command wasp dockerfile
.
Please note that the generated Dockerfile's content is dynamic and depends on which features your app uses. The content can also change in future releases, so please verify it from time to time.
For more information, you can refer to the Wasp documentation on customizing the Dockerfile (https://wasp-lang.dev/docs/advanced/deployment/overview#customizing-the-dockerfile).
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Gwaggli, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?Kapa is right, you can modify the
Dockerfile
by adding a Dockerfile
in your project root.
The simplest thing to do it to copy the full Dockerfile
from .wasp/out
or .wasp/build
and that's how you'll override the full Dockerfile
and you can then cusotmise it easily!