โWalk me through deploying a Dockerized web service to Render's free tier using 'Deploy from Dockerfile', connected to my GitHub repo.โ
12 โ [Optional] Deploy to Render
Category: Hosting & Deploy ยท Priority: Low ยท Optional
Use the free-tier Web Service. Select "Deploy from Dockerfile" โ Render auto-detects the Dockerfile.
โ ๏ธ OPTIONAL โ This task is only needed if you want to deploy your app to the internet. The core project works 100% locally without this.
๐ฏ What is this task?
Render is a hosting platform that can run your Docker container for free. You connect your GitHub repo, point it at your Dockerfile, and Render handles the rest โ no servers to manage.
๐ Step-by-step
Step 1 โ Push your code to GitHub first
If you haven't already:
# In your project folder
git init
git add .
git commit -m "Initial commit"
Then create a new repo on github.com and follow their instructions to push.
โ ๏ธ Make sure
.envis in your.gitignorebefore pushing!
Step 2 โ Create a Render account
Go to https://render.com and sign up (free). Connect your GitHub account when asked.
Step 3 โ Create a new Web Service
- Click "New +" โ "Web Service"
- Select your GitHub repo
- Under "Environment", select Docker
- Render will auto-detect your Dockerfile
Step 4 โ Configure the service
- Name:
my-docker-app - Region: pick closest to you
- Branch:
main - Instance Type: Free
Click "Create Web Service".
Step 5 โ Watch the deploy
Render will pull your code, build the Docker image, and start the container. This takes 2โ5 minutes. Watch the deploy logs for any errors.
โ Done when
- Code is pushed to GitHub (without
.env) - Render Web Service created and linked to repo
- Deploy completes without errors
- Render provides a public URL ending in
.onrender.com
๐ Quiz
Answer all 1 questions correctly to complete this lesson.