Skip to content

Commit d6eebdf

Browse files
committed
2 parents c51103b + 5704dbe commit d6eebdf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+3183
-1965
lines changed

blog/2024-11-13-october-product-updates.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,6 @@ The team is now heads-down dotting the i’s and crossing the t’s so we can re
5555

5656
<img src="/img/october-update/coffee-chat.png" alt="CoffeeChat" style={{ width: 300 }} />
5757

58-
## Defang Coffee Chat ☕
59-
60-
If you're excited about what's coming next and want to hear more about our vision for the future, join us for our Coffee Chat on November 27th 2024.
61-
We'll be sharing more about our roadmap and what we're working on next.
62-
63-
<Button href="https://lu.ma/4n54sy2v" variant="contained" size="large" target="_blank">
64-
Register here!
65-
</Button>
66-
6758
---
6859

6960
As always, we appreciate your feedback and are committed to making Defang the easiest way to develop, deploy, and debug your cloud applications. Go build something awesome! 🚀

blog/2025-03-07-feb-product-updates.md

Lines changed: 0 additions & 24 deletions
This file was deleted.
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
---
2+
slug: deploying-defang-with-defang-part-1
3+
title: "Deploying Defang with Defang: Part 1"
4+
author: Defang Team
5+
tags: [defang-with-defang, deployment, defang-portal]
6+
---
7+
8+
![Defang Compose Update](/img/defang-on-defang/part-1/header.png)
9+
10+
Deploying applications is hard. Deploying complex, multi-service applications is even harder. When we first built the Defang Portal, we quickly recognized the complexity required to deploy it, even with the early Defang tooling helping us simplify it a lot. But we’ve worked a lot to expand Defang’s capabilities over the last year+ so it could take on more of the work and simplify that process.
11+
12+
This evolution wasn’t just based on our own instincts and what we saw in the Portal—it was informed by listening to developers who have been using Defang, as well as our experience building dozens of sample projects for different frameworks and languages. Each time we build a new sample, we learn more about the different requirements of various types of applications and developers and refine Defang’s feature set accordingly. The Portal became an extension of this learning process, serving as both a proving ground and an opportunity to close any remaining gaps, since it’s one of the most complex things we’ve built with Defang.
13+
14+
Finally, though, the Defang Portal—an application with six services, including two managed data stores, authentication, and a frontend—is fully deployed using just Docker Compose files and the Defang CLI using GitHub Actions.
15+
16+
---
17+
18+
## **The Initial Setup: A More Complex Deployment**
19+
20+
The Portal isn’t a simple static website; it’s a **full-stack application** with the following services:
21+
22+
- **Next.js frontend** – Including server components and server actions.
23+
- **Hasura (GraphQL API)** – Serves as a GraphQL layer.
24+
- **Hono (TypeScript API)** – Lightweight API for custom business logic.
25+
- **OpenAuth (Authentication Service)** – Manages authentication flows.
26+
- **Redis** – Used for caching and session storage.
27+
- **Postgres** – The main database.
28+
29+
Initially, we provisioned databases and some DNS configurations using Infra-as-Code because Defang couldn’t yet manage them for us. We also deployed the services themselves manually through infrastructure-as-code, requiring us to define each service separately.
30+
31+
This worked, but seemed unnecessarily complex, if we had the right tooling…
32+
33+
---
34+
35+
## **The Transition: Expanding Defang to Reduce Complexity**
36+
37+
We’ve made it a priority to expand Defang’s capabilities a lot over the last year so it could take on more of the heavy lifting of a more complex application. Over the past year, we’ve added loads of features to handle things like:
38+
39+
- **Provisioning databases**, including managing passwords and other secrets securely
40+
- **Config interpolation using values stored in AWS SSM**, ensuring the same Compose file works both locally and in the cloud
41+
- **Provisioning certs and managing DNS records** from configuration in the Compose file.
42+
43+
As a result, we reached a point where we no longer needed custom infrastructure definitions for most of our deployment.
44+
45+
## **What Changed?**
46+
47+
- **Previously**: GitHub Actions ran infra-as-code scripts to provision databases, manage DNS, and define services *separately from the Docker Compose file we used for local dev*
48+
- **Now**: Our [**Defang GitHub Action**](https://github.com/marketplace/actions/defang-deployment-action) targets normal Compose files and deploys everything, using secrets and variables managed in GitHub Actions environments.
49+
- **Result**: We **eliminated hundreds of lines of Infra-as-Code**, making our deployment leaner and easier to manage and reducing the differences between running the Portal locally and running it in the cloud.
50+
51+
This wasn’t just about reducing complexity—it was also a validation exercise. We knew that Defang had evolved enough to take over much of our deployment, but by going through the transition process ourselves, we could identify and close the remaining gaps and make sure our users could really make use of Defang for complex production-ready apps.
52+
53+
---
54+
55+
## **How Deployment Works Today**
56+
57+
### **Config & Secrets Management**
58+
59+
- **Sensitive configuration values** (database credentials, API keys) are stored **securely in AWS SSM** using Defang’s [configuration management tooling](https://docs.defang.io/docs/concepts/configuration).
60+
- [**Environment variable interpolation**](https://docs.defang.io/docs/concepts/configuration#interpolation) allows these **SSM-stored config values** to be referenced directly in the Compose file, ensuring the same configuration works in local and cloud environments.
61+
- **Defang provisions managed Postgres and Redis instances automatically** when using the `x-defang-postgres` and `x-defang-redis` extensions, securely injecting credentials where needed with variable interpolation.
62+
63+
### Deployment Modes
64+
65+
- [**Deployment modes**](https://docs.defang.io/docs/concepts/deployment-modes) (`development`, `staging`, `production`) adjust infrastructure settings across our dev/staging/prod deployments making sure dev is low cost, and production is secure and resilient.
66+
67+
### **DNS & Certs**
68+
69+
- When we first set up the portal (before we even released the private beta) DNS and certs had to be managed outside the Defang context. Now, **[we can provision certs using ACM or Let’s Encrypt](https://docs.defang.io/docs/concepts/domains)**.
70+
71+
### **CI/CD Integration**
72+
73+
- **Previously**: GitHub Actions ran custom infra-as-code scripts.
74+
- **Now**: The [**Defang GitHub Action**](https://github.com/DefangLabs/defang-github-action) installs Defang automatically and runs `defang compose up`, simplifying deployment.
75+
- **Result**: A streamlined, repeatable CI/CD pipeline.
76+
77+
---
78+
79+
## **The Takeaway: Why This Matters**
80+
81+
By transitioning to **fully Compose-based deployments**, we:
82+
83+
***Eliminated hundreds of lines of Infra-as-Code**
84+
***Simplified configuration management** with secure, environment-aware secrets handling
85+
***Streamlined CI/CD** with a lightweight GitHub Actions workflow
86+
***Simplified DNS and cert management**
87+
88+
Every sample project we built, every conversation we had with developers, and every challenge we encountered with the Portal helped us get to this point where we could focus on closing the gaps last few gaps to deploying everything from a Compose file.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
title: February 2025 Defang Compose Update
3+
tags:
4+
[
5+
Cloud,
6+
DevOps,
7+
Pulumi,
8+
Compose,
9+
OpenAuth,
10+
Portal,
11+
Events,
12+
]
13+
author: Defang Team
14+
---
15+
16+
![Defang Compose Update](/img/defang-compose-update.webp)
17+
18+
Well, that went by quick! Seems like it was just a couple of weeks ago that we published the Jan update, and it’s already time for the next one. Still, we do have some exciting progress to report in this short month!
19+
20+
1. **Pulumi Provider:** We are excited to announce a Preview of the [Defang Pulumi Provider](https://github.com/DefangLabs/pulumi-defang/). With the Defang Pulumi Provider, you can leverage all the power of Defang with all of the extensibility of Pulumi. Defang will provision infrastructure to deploy your application straight from your Compose file, while allowing you to connect that deployment with other resources you deploy to your cloud account. The new provider makes it easy to leverage Defang if you’re already using Pulumi, and it also provides an upgrade-path for users who need more configurability than the Compose specification can provide.
21+
2. **Portal Update:** We are now fully deploying our portal with Defang alone using the `defang compose up` command. Our original portal architecture was designed before we supported managed storage so we used to use Pulumi to provision and connect external storage. But since we added support in Compose to specify managed storage, we can fully describe our Portal using Compose alone. This has allowed us to rip out hundreds of lines of code and heavily simplify our deployments. To learn more about how we do this, check out our Defang-Deployed-with-Defang (Part 1) [blog](https://docs.defang.io/blog/deploying-defang-with-defang-part-1).
22+
3. **Open-Auth Contribution:** In the past couple months we have been communicating with the OpenAuth maintainers and contributors via PRs ([#120](https://github.com/toolbeam/openauth/pull/120), [#156](https://github.com/toolbeam/openauth/pull/156)) and Issues ([#127](https://github.com/toolbeam/openauth/issues/127)) to enable features like local testing with DynamoDB, enabling support for scopes, improving standards alignment, supporting Redis, and more. We are rebuilding our authentication systems around OpenAuth and are excited about the future of the project.
23+
24+
**Events and Social Media**
25+
26+
February was an exciting month for the Defang team as we continued to engage with the developer community and showcase what’s possible with Defang. We sponsored and demo’ed at the [DevTools Vancouver meetup](https://lu.ma/devtools3), as well as sponsored the [Vancouver.dev IRL: Building AI Startups](https://lu.ma/vandevirl2) event. Also, at the AWS Startup Innovation Showcase in Vancouver, our CTO [Lio](https://www.linkedin.com/in/lionello/) [demonstrated](https://www.linkedin.com/feed/update/urn:li:activity:7299861024780808193) how Defang makes it effortless to deploy secure, scalable, and cost-efficient serverless apps on AWS! And finally, we had a great response to our [LinkedIn post](https://www.linkedin.com/posts/defanglabs_mcp-docker-anthropic-activity-7298043665883508736-i4dd?utm_source=share&utm_medium=member_desktop&rcm=ACoAAAAQqiEBLsVLYYAzEmBFB9oIl31nQ7kDII0) on the Model Context Protocol, catching the attention of many observers, including some of our key partners.
27+
28+
We are eager to see what you deploy with Defang. Join our [Discord](http://s.defang.io/discord) to ask any questions, see what others are building, and share your own experience with Defang. And stay tuned for more to come in March!
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
---
2+
slug: deploying-defang-with-defang-part-2
3+
title: "Deploying Defang with Defang: Part 2"
4+
author: Defang Team
5+
tags: [defang-with-defang, deployment, defang-website]
6+
---
7+
8+
![Defang Compose Update](/img/defang-on-defang/part-2/header.png)
9+
10+
When we refreshed the Defang brand, we knew our website needed more than just a fresh coat of paint. It needed to become a more dynamic part of our stack. We needed some parts to be more flexible, some parts to be more interactive, and better aligned with how modern apps are organized and deployed. And what better way to take it there than to deploy it with Defang itself?
11+
12+
This is part of our ongoing "Defang on Defang" series, where we show how we're using our own tool to deploy all the services that power Defang. In this post, we're diving into how we turned our own website into a project to better understand how Defang can be used to deploy a dynamic Next.js apps and how we can improve the experience for developers.
13+
14+
---
15+
16+
## From S3 + CloudFront to Dynamic, Containerized Deployments
17+
18+
Our original site was a Next.js app using [static exports](https://nextjs.org/docs/pages/building-your-application/deploying/static-exports) deployed via S3 and fronted by CloudFront. That setup worked for a while—it was fast and simple. But with our brand refresh, we added pages and components where it made sense to use (and test for other developers) some Next.js features that we couldn't use with the static export:
19+
20+
- [React Server Components](https://nextjs.org/docs/app/building-your-application/rendering/server-components)
21+
- [Server Actions](https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations)
22+
- [ISR](https://nextjs.org/docs/app/building-your-application/data-fetching/incremental-static-regeneration)
23+
24+
That meant static hosting wouldn't cut it. So we decided to run the site as an app in a container.
25+
26+
That being said, our learnings from the previous setup *are* being used to develop the capabilities of Defang. We're using the experience to make sure that Defang can handle the deployment of static sites as well as dynamic ones. We'll keep you updated when that's ready.
27+
28+
---
29+
30+
## Deploying with Defang (and Why It Was Easy)
31+
32+
We already deploy our other services with Defang using Compose files. In fact, the static website actually already used a Dockerfile and Compose file to manage the build process. So we just had to make some minor changes to the Compose file to take into account new environment variables for features we're adding and make a few small changes to the Dockerfile to handle the new build process.
33+
34+
Some things we had to change:
35+
36+
**Adding [ports](https://docs.defang.io/docs/concepts/compose#ports) to the Compose file**:
37+
```yaml
38+
ports:
39+
- mode: ingress
40+
target: 3000
41+
published: 3000
42+
```
43+
44+
**Adding [domain](https://docs.defang.io/docs/concepts/domains) info the Composer file**:
45+
```yaml
46+
domainname: defang.io
47+
networks:
48+
default:
49+
aliases:
50+
- www.defang.io
51+
```
52+
53+
One other hiccup was that we used to do www to non-www redirects using S3. There are a few ways to switch that up, but for the time being we decided to use Next.js middleware.
54+
55+
Pretty soon after that, the site was up and running in an AWS account—with TLS, DNS, and both the `www` and root domains automatically configured. Pretty straightfoward!
56+
57+
---
58+
59+
## Real-World Lessons That Are Shaping Defang
60+
61+
Deploying the website wasn't just a checkbox—it helped surface real-world pain points and ideas for improvement.
62+
63+
### 1. Static Assets Still Need CDNs
64+
Even though the site is dynamic now, we still want assets like `/_next/static` to load quickly from a CDN. This made it clear that CDN support—like CloudFront integration—should be easier to configure in Defang. That’s now on our roadmap. That's also going to be useful for other frameworks that use similar asset paths, like Django.
65+
66+
### 2. Next.js Env Vars Can Be Tricky in Containers
67+
Next.js splits env vars between build-time and runtime, and the rules aren’t always obvious. Some need to be passed as build args, and others as runtime envs. That made us think harder about how Defang could help clarify or streamline this for developers—even if we can’t change that aspect of Next.js itself.
68+
69+
### 3. Redirects and Rewrites
70+
We had to add a middleware to handle www to non-www redirects. This is a common need, so we're keeping an eye on how we can make this easier to deal with in Defang projects.
71+
72+
These are the kinds of things we only notice by using Defang on real-world projects.
73+
74+
---
75+
76+
## The Takeaway
77+
78+
Our site now runs like the rest of our infrastructure:
79+
80+
- Fully containerized
81+
- Deployed to our own AWS account
82+
- Managed with a Compose file
83+
- Deployed with Defang
84+
85+
Stay tuned for the next post in the series—because this is just one piece of the puzzle.
86+

0 commit comments

Comments
 (0)