Week3 - Server, Domain, Docker, CI/CD, Gemini Pro
Building an intranet for a team of 20-30 people is a manageable task, and starting with a cloud-based approach is both cost-effective and scalable.
Server (AWS Lightsail)
1. AWS Lightsail For a small to medium-sized internal project, AWS Lightsail is the best starting point compared to EC2.
Why Lightsail? It is essentially an "all-in-one" simplified VPS (Virtual Private Server). It provides a predictable, fixed monthly price and comes with a user-friendly interface that doesn't require advanced network engineering skills.
Scalability: If your team grows significantly in the future, you can easily upgrade the server plan (vertical scaling) or migrate to the more robust EC2 environment later.
2. Database Capacity & Management Initial Size: Start with 1GB to 5GB. This is more than enough for basic user data, posts, and work logs.
Best Practice (Storage Strategy): Do not store large files (like PDFs, images, or documents) directly in the database. Instead, use Object Storage (like AWS S3) to store the files and save only the file path (URL) in your database. This keeps your database lightweight and high-performing.
Monitoring: Use your cloud provider’s Monitoring/Alerting feature. Set an alert to notify you via email when the database usage reaches 70-80%, so you can expand before it ever hits full capacity.
3. Domain Name Strategy You are not required to use a .com.au domain if it complicates your administrative process.
The .com.au Requirement: Note that .com.au requires proof of Australian business registration (ABN/ACN).
The Recommendation: Use a .com domain. It is globally recognized, requires no business registration documents, and is easier to manage for an internal project.
Where to Buy:
Cloudflare: Recommended for transparency and low, consistent pricing.
Namecheap: Known for its user-friendly interface.
Estimated Cost: Approximately $15–$25 AUD per year. Always check the "Renewal Price" to avoid hidden cost hikes after the first year.
Important Settings:
WHOIS Privacy: Ensure this is enabled (usually free) to protect your contact information.
Auto-Renewal: Keep this ON to prevent any accidental service disruptions.
Summary Checklist for Success Start Simple: Deploy your project on AWS Lightsail in the Sydney region for optimal local speed.
Pick a Domain: Buy a .com domain from a reputable registrar like Cloudflare or Namecheap.
Manage Files Outside the DB: Keep documents and images in object storage to keep your database fast.
Set Up Alerts: Enable usage monitoring to stay ahead of storage limits.
By following this path, you avoid the administrative overhead of Australian business verification while keeping your infrastructure professional, scalable, and easy to maintain.
Domain (AWS Route 53)
The difference in cost between AWS Route 53 and other professional registrars like Cloudflare or Namecheap is minimal for a small intranet, but there is a structural difference you should know.
1. Cost Comparison Breakdown
| Feature | AWS Route 53 | Cloudflare / Namecheap |
|---|---|---|
| Domain Registration | ~$12–$15 per year | ~$10–$15 per year |
| DNS Hosting Fee | $0.50/month (per Hosted Zone) | Free |
| Total Annual Cost | ~$18–$21 | ~$10–$15 |
AWS Route 53: While the domain price is competitive, AWS charges a fixed fee of \(0.50 per month for every "Hosted Zone" (the container where your DNS records live). This translates to an extra \)6.00 per year.
Cloudflare/Namecheap: They typically provide DNS hosting for free. You only pay the annual domain registration fee.
2. Why the Difference Exists
AWS Route 53 is designed for enterprise-grade reliability, deep integration with other AWS services (like Lightsail or EC2), and advanced traffic routing. That $0.50/month is a small price for the "all-in-one" convenience of managing your infrastructure and DNS in a single AWS dashboard.
Cloudflare/Namecheap focus on being the "front door" for your domain. They offer DNS management for free as a way to win your business, hoping you will eventually use their premium security or CDN services.
3. Practical Recommendation
Choose AWS Route 53 if: You value convenience and workflow. Since you are planning to use AWS Lightsail for your server, keeping your domain and DNS inside the AWS ecosystem will save you time and simplify your setup. The ~$6 annual difference is negligible compared to the time you save by not needing to copy/paste DNS settings between different platforms.
Choose Cloudflare if: You are strictly cost-conscious and prefer to keep your DNS management separate from your hosting provider. Cloudflare, in particular, offers excellent performance and security features for free.
Final Verdict: For a 20-30 person intranet, going with AWS Route 53 is the most efficient choice because it keeps everything under one roof. The small monthly fee is a fair trade for the reduced complexity in managing your infrastructure.
Are you ready to start setting up your Lightsail server, or would you like to know how to connect the domain once you purchase it?
Docker
1. Why Docker? (Environment Consistency)
Docker solves the "it works on my machine but not on the server" problem.
Portability: By "containerizing" your application, you bundle the code and all its dependencies together. If you ever need to move to a larger server or change providers, you simply move the Docker image, and it will run exactly the same way.
Management: For a small team, a simple
docker-compose.ymlfile is enough to manage your entire stack with a single command. It makes server setup and recovery extremely fast.
2. Why CI/CD? (Automation & Reliability)
Even with Docker, manually logging into the server, running git pull, and rebuilding containers is tedious and prone to human error.
Automation: With a CI/CD pipeline, you simply push your code to GitHub. The pipeline automatically builds your new Docker image and deploys it to the server.
Rollbacks: If a new update introduces a bug, you can revert to the previous version with a single click or command, minimizing downtime for your employees.
3. Recommended Toolkit for Small Teams
Avoid overly complex enterprise tools (like Jenkins) that require their own maintenance. Stick to lightweight, integrated solutions:
GitHub Actions: (Highly Recommended) It is free, integrated directly into your GitHub repository, and requires no extra server setup. You just create a
.yamlconfiguration file, and it handles the rest.GitHub Container Registry (GHCR): This serves as your "storage" for Docker images, which your server pulls from to update itself.
The Workflow:
Code: You update your code and push it to GitHub.
CI/CD: GitHub Actions detects the push, builds a new Docker image, and pushes it to the Registry.
Deployment: The server pulls the new image and automatically restarts the container.
4. Implementation Roadmap
Phase 1 (Containerization): Create a
Dockerfilefor your application. This makes your project portable immediately.Phase 2 (Automate Deployment): Use GitHub Actions to automate the build and push process.
Phase 3 (Monitoring): Run a lightweight tool like Uptime Kuma in a container. It provides a simple dashboard to ensure your intranet is always online and alerts you if it goes down.
CI/CD (Github Actions)
1. Why GitHub Actions is "The Standard"
Deep Integration: Since your code is likely already on GitHub, you don't need to configure a separate CI/CD server (like Jenkins). It is already "wired up."
Zero Infrastructure Overhead: You don't need to manage a dedicated server just to run your CI/CD pipeline. GitHub provides the "runners" (the virtual machines that execute your build scripts) for free within your usage limits.
Simple Configuration: You define your entire pipeline in a single
.yamlfile inside your repository (.github/workflows/deploy.yml). This means your "infrastructure as code" is versioned right alongside your application code.
2. How it works for your Docker Setup
The typical workflow for your intranet would look like this:
Push: You push your code to your repository.
Build: GitHub Actions triggers a "Job." It builds a Docker image based on your
Dockerfile.Push to Registry: GitHub Actions pushes that image to the GitHub Container Registry (GHCR).
Deploy: GitHub Actions sends a small command (via SSH) to your AWS Lightsail instance. The server then pulls the new image and restarts the container.
3. Pros and Cons for Your Intranet
Feature | GitHub Actions |
Setup Time | Very fast (there are pre-built templates for Docker). |
Cost | Free for private repositories (within generous usage limits). |
Complexity | Low—perfect for a team of your size. |
Portability | High—if you move from AWS to another provider, your CI/CD stays the same. |
Gemini Pro
Recommended for Developers: Google AI Pro
The AI Pro plan is optimized for power users and developers who need more than just casual assistance.
Price: $19.99/month (The previous mention of 29,000 KRW was an approximation; please check your local Google One/Gemini interface for exact regional pricing).
Why it’s great for coding:
Higher Usage Limits: You get 4x higher usage limits compared to the free tier, which is crucial when debugging or analyzing large codebases.
Advanced Models: Access to Gemini 3.1 Pro, which is significantly better at complex logic, refactoring, and following architectural constraints.
Developer Tools: Includes expanded access to Jules (an autonomous coding agent) and Google Antigravity (an agentic development platform) for building and testing features.
Deep Research: Better capacity for deep-diving into documentation or complex technical problems.
Integrated Productivity: Features like Gemini in Docs, Sheets, and Gmail help with technical documentation and project management.
Overview of Google AI Plans
| Plan | Price (approx.) | Best For |
|---|---|---|
| Free | $0 | Casual use, quick questions, testing small snippets. |
| AI Plus | $4.99/month | Moderate users, 400GB storage, 2x limits. |
| AI Pro | $19.99/month | Developers, power users, 4x limits, pro features. |
| AI Ultra | $99.99+/month | Enterprise-level tasks, 20x+ limits, advanced agents. |
How to leverage this for your development:
Use Jules: Since you are encountering specific errors like
relation does not exist, you can connect your GitHub repository to Jules. It will analyze your codebase, understand your schema, and suggest fixes autonomously.Use AI Studio: If you are building an application, the AI Pro subscription includes expanded access to Google AI Studio, where you can prototype and experiment with the latest models using API keys.
Context Sharing: When you run into issues, don't just paste the error. Provide the relevant
schema.sqlormodels.pyfile to Gemini. With the higher context window in the Pro plan, the model will be able to map your database schema to your code to pinpoint exactly where the mismatch is occurring.