Skip to main content

Static websites

Static websites are all the rage when it comes to fast-loading frontend applications. They're cheap to operate because they can easily be cached by your favorite CDNs for edge distribution.

In this guide, you'll learn all about testing and debugging static websites using Architect and employing common CDNs for improved production performance. If you want to skip the tutorial and start from a working project, feel free to run architect init to have everything done for you.

Creating the service

The interesting thing about developing static sites is that they're never static when they're actively being worked on. If you're making code changes, the whole site needs to be recompiled before it can be rendered.

Fortuntely, Architect makes it easy for developers to create components with different behavior for dev and production deployments. Developers can use different dockerfiles or commands using the debug block to facilitate hot-reloading in their favorite languages and frameworks.

services:
api:
build:
context: ./
interfaces:
main:
port: 8080
debug:
build:
dockerfile: Dockerfile.dev
volumes:
src:
mount_path: /app/src
host_path: ./src

Setup caching w/ Cloudflare