Skip to content

Commit 338d772

Browse files
authored
copy edits
1 parent e43dc15 commit 338d772

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

blog/2025-03-26-deploying-defang-with-defang-part-2.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ tags: [defang-with-defang, deployment, defang-website]
77

88
![Defang Compose Update](/img/defang-on-defang/part-1/header.png)
99

10-
When we rebranded Defang, 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?
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?
1111

1212
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.
1313

1414
---
1515

1616
## From S3 + CloudFront to Dynamic, Containerized Deployments
1717

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 rebrand, 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:
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:
1919

2020
- [React Server Components](https://nextjs.org/docs/app/building-your-application/rendering/server-components)
2121
- [Server Actions](https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations)
@@ -33,15 +33,15 @@ We already deploy our other services with Defang using Compose files. In fact, t
3333

3434
Some things we had to change:
3535

36-
**Adding ports to the Compose file**:
36+
**Adding [ports](https://docs.defang.io/docs/concepts/compose#ports) to the Compose file**:
3737
```yaml
3838
ports:
3939
- mode: ingress
4040
target: 3000
4141
published: 3000
4242
```
4343
44-
**Adding domain info the Composer file**:
44+
**Adding [domain](https://docs.defang.io/docs/concepts/domains) info the Composer file**:
4545
```yaml
4646
domainname: defang.io
4747
networks:
@@ -64,7 +64,7 @@ Deploying the website wasn't just a checkbox—it helped surface real-world pain
6464
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.
6565

6666
### 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 (or our docs) could help clarify or streamline this for developers—even if we can’t change that aspect of Next.js itself.
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.
6868

6969
### 3. Redirects and Rewrites
7070
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.
@@ -79,7 +79,7 @@ Our site now runs like the rest of our infrastructure:
7979

8080
- Fully containerized
8181
- Deployed to our own AWS account
82-
- Managed with a Composer file
82+
- Managed with a Compose file
8383
- Deployed with Defang
8484

8585
Stay tuned for the next post in the series—because this is just one piece of the puzzle.

0 commit comments

Comments
 (0)