Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
gregsadetsky committed Aug 11, 2024
1 parent bb39d3b commit f5ea49f
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 40 deletions.
4 changes: 2 additions & 2 deletions docs/exhaustive-documentation/environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ console.log(`Hello ${process.env.VAR_NAME}`)

## Using Environment Variables When Building Images

When building Docker images, we need to be careful to avoid including the variables in the images. Disco uses the recommended way to expose environment variables without baking them into the images.
When building Docker images, we need to be careful to avoid including the variables in the images. disco uses the recommended way to expose environment variables without baking them into the images.

See Docker documentation about [Build Secrets](https://docs.docker.com/build/building/secrets/) for more info.

Expand Down Expand Up @@ -86,7 +86,7 @@ The [Docker documentation](https://docs.docker.com/build/building/secrets/#targe
RUN --mount=type=secret,id=aws,target=/root/.aws/credentials \
aws s3 cp ...
```
We can adapt it to Disco's environment variables like
We can adapt it to disco's environment variables like
```bash
disco env:set --projecct my-project AWS_CREDENTIALS='...'
```
Expand Down
6 changes: 3 additions & 3 deletions docs/exhaustive-documentation/images.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ You can avoid talking about images in your `disco.json` file by relying on the d

This `disco.json` above uses the defaults. More on this below.

When you don't specify the image to use for a service, Disco will default to the image named `default`.
When you don't specify the image to use for a service, disco will default to the image named `default`.

Those two `disco.json` are equivalent, defining `"image"` or not in the definition of `"web"`:

Expand Down Expand Up @@ -84,7 +84,7 @@ and
}
```

Also, when not defining the `default` image, Disco will assume the default value shown above. That is, the `Dockerfile` at the root of the repository, the build context as well. Meaning that this third `disco.json` is also equivalent:
Also, when not defining the `default` image, disco will assume the default value shown above. That is, the `Dockerfile` at the root of the repository, the build context as well. Meaning that this third `disco.json` is also equivalent:
```json
{
"version": "1.0",
Expand Down Expand Up @@ -175,7 +175,7 @@ or another exmaple, if the Dockerfile is in a sub-directory, but should be built

## Using Publicly Downloadable Images

If the name of the image to use is not defined in `images`, Disco will see if it can download it.
If the name of the image to use is not defined in `images`, disco will see if it can download it.

```json
{
Expand Down
8 changes: 4 additions & 4 deletions docs/exhaustive-documentation/ports.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Web

When deploying a web application, the way to have the web traffic served through Disco's reverse proxy is to specify the port in your `disco.json`.
When deploying a web application, the way to have the web traffic served through disco's reverse proxy is to specify the port in your `disco.json`.

```json
{
Expand All @@ -16,9 +16,9 @@ When deploying a web application, the way to have the web traffic served through
}
```

That way, requests come in to your server on port 443 (for https) and Disco's reverse proxy will forward the request to your app on port 8080.
That way, requests come in to your server on port 443 (for https) and disco's reverse proxy will forward the request to your app on port 8080.

Also, note that the name `web` for the service is important. Disco will use that service to expose to the internet. You can't specify `port` on a service not named `web`.
Also, note that the name `web` for the service is important. disco will use that service to expose to the internet. You can't specify `port` on a service not named `web`.

## Internal Communication Between Services

Expand Down Expand Up @@ -94,4 +94,4 @@ In the case where you would like to expose a port externally, bypassing the reve

In this case, the container's port `11000` will be exposed on the server directly as port `12000`. Also, the protocol defined is `udp`, or `tcp`.

Since it does not go through the reverse proxy, Disco will not provide a TLS certificate for HTTPS.
Since it does not go through the reverse proxy, disco will not provide a TLS certificate for HTTPS.
2 changes: 1 addition & 1 deletion docs/exhaustive-documentation/postgresql.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ You can attach many databases to a single project. And you can attach the same d

### Remote Access

As you saw in the `DATABASE_URL` value, the hostname was `postgres-instance-nuclear-rabbit-postgres`. It's not exposed to the internet. It's only accessible to the projects running on your Disco installation.
As you saw in the `DATABASE_URL` value, the hostname was `postgres-instance-nuclear-rabbit-postgres`. It's not exposed to the internet. It's only accessible to the projects running on your disco installation.

If you want to access it remotely, from your laptop for example, you can create a temporary tunnel.

Expand Down
2 changes: 1 addition & 1 deletion docs/exhaustive-documentation/volumes.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ Volumes are scoped per project. If you use the same volume name for 2 different

## Scaling Considerations

When running Disco with multiple servers (nodes in a swarm), usually, services will be spread on all servers automatically to spread the load. However, when using volumes, Disco will force the services to run on the main node and the volumes will be created on the hard drive of the main node. In other words, services that use volumes will not scale horiztonally.
When running disco with multiple servers (nodes in a swarm), usually, services will be spread on all servers automatically to spread the load. However, when using volumes, disco will force the services to run on the main node and the volumes will be created on the hard drive of the main node. In other words, services that use volumes will not scale horiztonally.
2 changes: 1 addition & 1 deletion docs/exhaustive-documentation/worker-processes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Worker Processes

In your `disco.json` file, you can define many services. The one that has the name `web` will be exposed to the internet by Disco. The other ones will just run.
In your `disco.json` file, you can define many services. The one that has the name `web` will be exposed to the internet by disco. The other ones will just run.

```json
{
Expand Down
18 changes: 9 additions & 9 deletions docs/get-started/set-up-your-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ sidebar_position: 4

# Set up your App

In this docs you will learn the basics to get your existing app running on Disco. If you have a static site or a static site generator, refer to these sections instead.
In this docs you will learn the basics to get your existing app running on disco. If you have a static site or a static site generator, refer to these sections instead.

## Overview

At this point, you already have installed the CLI on your computer, installed Disco on your server, and you have added your Disco Github app with the permissions to your repository on Github.
At this point, you already have installed the CLI on your computer, installed disco on your server, and you have added your disco Github app with the permissions to your repository on Github.

After this guide, you will have a `Dockerfile` to build the image of your app, and you'll have a `disco.json` file describing how the app should run on Disco.
After this guide, you will have a `Dockerfile` to build the image of your app, and you'll have a `disco.json` file describing how the app should run on disco.

### The app before Disco
### The app before disco

Let's use a very basic Flask app so that we have something to work with.

Expand Down Expand Up @@ -60,7 +60,7 @@ $ flask --app hello run

### Create your Dockerfile

Apps on Disco run inside Docker containers. We need a Dockerfile to build the image that will be used by those containers. If you've never worked with Docker or `Dockerfile`, the general idea is that the `Dockerfile` will build everything needed to run the app, so that we can use it later to execute the app. You can see it as a `makefile` to build binaries that you'll later use when you want to run the app.
Apps on disco run inside Docker containers. We need a Dockerfile to build the image that will be used by those containers. If you've never worked with Docker or `Dockerfile`, the general idea is that the `Dockerfile` will build everything needed to run the app, so that we can use it later to execute the app. You can see it as a `makefile` to build binaries that you'll later use when you want to run the app.

For this example, in Python, we'll use the official Python image from Docker Hub. Just create a file named `Dockerfile` at the root of your repository.

Expand All @@ -75,7 +75,7 @@ See [notes below](#optimizing-the-dockerfile) for some optimizations we can make

### Create your disco.json

Create a file named `disco.json` at the root of your repository. The `disco.json` file tells Disco how to run your app.
Create a file named `disco.json` at the root of your repository. The `disco.json` file tells disco how to run your app.

One note is that services have to be accessible from the outside. See [Externally Visible Server](https://flask.palletsprojects.com/en/3.0.x/quickstart/#public-server) in Flask's docs. While the flag `--host=0.0.0.0` is Flask specific, the concept applies to most apps: it may bind to `127.0.0.1` (`localhost`) by default, meaning only requests coming from "inside" would be able to reach the app. This is a great default for developping on your computer, but to deploy your application, it needs to be accessible from the outside, so that the reverse proxy in front of your app can talk to it.

Expand All @@ -91,11 +91,11 @@ One note is that services have to be accessible from the outside. See [Externall
}
```

The name `web` is a magic name. When Disco sees it, it knows that it's the one to use to expose to the internet, create a TLS certificate for HTTPS, etc.
The name `web` is a magic name. When disco sees it, it knows that it's the one to use to expose to the internet, create a TLS certificate for HTTPS, etc.

### That's it!

Your app is now ready to be deployed on Disco. You can use the CLI to add the project.
Your app is now ready to be deployed on disco. You can use the CLI to add the project.

```bash
disco projects:add \
Expand All @@ -104,7 +104,7 @@ disco projects:add \
--domain first-app.example.com
```

And now, every time you `git push` new commits, Disco will deploy the app automatically.
And now, every time you `git push` new commits, disco will deploy the app automatically.

You can see the deployment output with:
```bash
Expand Down
4 changes: 2 additions & 2 deletions docs/get-started/set-up-your-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ You will also need a dedicated domain name for the server itself (in addition to

## Step One: disco init

First, you need to install Disco on your server. For this, you run `disco init` and you pass it the SSH `user@DOMAIN` to use for Disco.
First, you need to install disco on your server. For this, you run `disco init` and you pass it the SSH `user@DOMAIN` to use for disco.


For example, if the user is `root` and the domain is `disco.example.com`
Expand All @@ -22,7 +22,7 @@ disco init [email protected]

## Step Two: Add the Github app

Once Disco is installed, it will need to be connected to Github.
Once disco is installed, it will need to be connected to Github.

Run
```bash
Expand Down
18 changes: 9 additions & 9 deletions docs/get-started/set-up-your-static-site-generator-site.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ sidebar_position: 6

# Set up your Static Site Generator (SSG)

In this docs you will learn the basics to get your existing static site generator site building on Disco and being served by Disco. If you have a static site or running apps, refer to these sections instead.
In this docs you will learn the basics to get your existing static site generator site building on disco and being served by disco. If you have a static site or running apps, refer to these sections instead.

## Overview

At this point, you already have installed the CLI on your computer, installed Disco on your server, and you have added your Disco Github app with the permissions to your repository on Github.
At this point, you already have installed the CLI on your computer, installed disco on your server, and you have added your disco Github app with the permissions to your repository on Github.

In this guide, you will have a `Dockerfile` to build your site, and you'll have a `disco.json` file telling Disco where to find the files to be served within your image.
In this guide, you will have a `Dockerfile` to build your site, and you'll have a `disco.json` file telling disco where to find the files to be served within your image.

### The site before Disco
### The site before disco

Let's use a very barebone home made site generator as an example.

Expand Down Expand Up @@ -72,7 +72,7 @@ python generate.py

### Create your Dockerfile

Static sites generator on Disco are built using a `Dockerfile`.
Static sites generator on disco are built using a `Dockerfile`.

For this example, in Python, we'll use the official Python image from Docker Hub. Just create a file named `Dockerfile` at the root of your repository.

Expand All @@ -88,7 +88,7 @@ See [notes below](#optimizing-the-dockerfile) for some optimizations we can make

### Create your disco.json

Create a file named `disco.json` at the root of your repository. The `disco.json` file tells Disco where to find the files to serve inside the Docker image we just built with the `Dockerfile` above.
Create a file named `disco.json` at the root of your repository. The `disco.json` file tells disco where to find the files to serve inside the Docker image we just built with the `Dockerfile` above.

```json
{
Expand All @@ -101,14 +101,14 @@ Create a file named `disco.json` at the root of your repository. The `disco.json
}
}```

The name `web` is a magic name. When Disco sees it, it knows that it's the one to use to expose to the internet, create a TLS certificate for HTTPS, etc.
The name `web` is a magic name. When disco sees it, it knows that it's the one to use to expose to the internet, create a TLS certificate for HTTPS, etc.

`publicPath` is relative to the `WOKRDIR` in your `Dockerfile`. In our example, the directory `dist` actually means `/app/dist` in our Docker image.


### That's it!

Your site is now ready to be deployed on Disco. You can use the CLI to add the project.
Your site is now ready to be deployed on disco. You can use the CLI to add the project.

```bash
disco projects:add \
Expand All @@ -117,7 +117,7 @@ disco projects:add \
--domain first-site.example.com
```

And now, every time you `git push` new commits, Disco will deploy the site automatically.
And now, every time you `git push` new commits, disco will deploy the site automatically.

You can see the deployment output with:
```bash
Expand Down
16 changes: 8 additions & 8 deletions docs/get-started/set-up-your-static-site.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ sidebar_position: 5

# Set up your Static Site

In this docs you will learn the basics to get your existing static site being served by Disco. If you have static files ready to serve, you're at the right place. If you're looking for static site generators or running apps, have a look at their sections in the docs.
In this docs you will learn the basics to get your existing static site being served by disco. If you have static files ready to serve, you're at the right place. If you're looking for static site generators or running apps, have a look at their sections in the docs.

## Overview

At this point, you already have installed the CLI on your computer, installed Disco on your server, and you have added your Disco Github app with the permissions to your repository on Github.
At this point, you already have installed the CLI on your computer, installed disco on your server, and you have added your disco Github app with the permissions to your repository on Github.

You already have static files to serve. You just need to tell Disco where to find them in your repository, by using a `disco.json` file.
You already have static files to serve. You just need to tell disco where to find them in your repository, by using a `disco.json` file.

### The site before Disco
### The site before disco

Let's say you have a folder called `public` that contains an HTML file `index.html`.
```
Expand All @@ -38,7 +38,7 @@ public

### Create your disco.json

Create a file named `disco.json` at the root of your repository. The `disco.json` file tells Disco where to find your files.
Create a file named `disco.json` at the root of your repository. The `disco.json` file tells disco where to find your files.

```json
{
Expand All @@ -52,13 +52,13 @@ Create a file named `disco.json` at the root of your repository. The `disco.json
}
```

The name `web` is a magic name. When Disco sees it, it knows that it's the one to use to expose to the internet, create a TLS certificate for HTTPS, etc.
The name `web` is a magic name. When disco sees it, it knows that it's the one to use to expose to the internet, create a TLS certificate for HTTPS, etc.

`publicPath` is relative to the root of your repository. In our example, the directory `public` sits at the root of the repository.

### That's it!

Your site is now ready to be deployed on Disco. You can use the CLI to add the project.
Your site is now ready to be deployed on disco. You can use the CLI to add the project.

```bash
disco projects:add \
Expand All @@ -67,7 +67,7 @@ disco projects:add \
--domain first-site.example.com
```

And now, every time you `git push` new commits, Disco will deploy the site automatically.
And now, every time you `git push` new commits, disco will deploy the site automatically.

You can see the deployment output with:
```bash
Expand Down

0 comments on commit f5ea49f

Please sign in to comment.