Skip to content

Commit 86132ee

Browse files
committed
Update virtual port.
1 parent 0d22112 commit 86132ee

2 files changed

Lines changed: 24 additions & 3 deletions

File tree

.github/workflows/README.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ A t2.micro or larger will work fine, this pattern can be used to host multiple a
3030
### Configure Instance
3131
Under `IAM role`, use the `ecsInstanceRole`, if this is not available, see [AWS documentation for the process of checking if it exists and creating it if needed](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/instance_IAM_role.html).
3232

33+
If you are not using your own generated Elastic IP, select `Enabled` for `Auto-assign Public IP`.
34+
3335
You will also want to add the following Userdata script (in the `Configure` step of the launch wizard) with your own `ECS_CLUSTER` value. This tells the ecs-agent running on the instance which ECS cluster the instance should join.
3436

3537
```bash
@@ -52,15 +54,30 @@ You'll want to expose at least ports 80 and 443.
5254

5355
### Setup Docker-compose and nginx-proxy
5456
To let your server handle multiple ServiceStack applications and automate the generation and management of TLS certificates, an additional docker-compose file is provided via the `x mix` template, `nginx-proxy-compose.yml`. This docker-compose file is ready to run and can be copied to the deployment server.
55-
> This is done via docker-compose rather than via ECS for simplicity.
57+
> This is done via docker-compose rather than via ECS itself for simplicity.
58+
59+
First you'll need to install `docker-compose`.
60+
61+
```bash
62+
sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
63+
sudo chmod +x /usr/local/bin/docker-compose
64+
```
65+
Run `docker-compose --version` to confirm.
66+
67+
To copy you can use scp or just creating a new file via server text editor to copy the short YML file over. For this example, we are going to copy it straight to the ~/ (home) directory.
68+
69+
```bash
70+
scp -i <path to private ssh key> ./nginx-proxy-compose.yml ec2-user@<server_floating_ip>:~/nginx-proxy.compose.yml
71+
```
5672

5773
For example, once copied to remote `~/nginx-proxy-compose.yml`, the following command can be run on the remote server.
5874

5975
```
6076
docker-compose -f ~/nginx-proxy-compose.yml up -d
6177
```
6278

63-
This will run an nginx reverse proxy along with a companion container that will watch for additional containers in the same docker network and attempt to initialize them with valid TLS certificates.
79+
This will run an nginx reverse proxy along with a companion container that will watch for additional containers in the same docker network and attempt to initialize them with valid TLS certificates. This includes containers created and managed by the ECS agent.
80+
> If the container doesn't have the environment variable `VIRTUAL_HOST` set, it will be ignored.
6481
6582
## GitHub Repository setup
6683
The `release.yml` assumes 6 secrets have been setup.
@@ -69,7 +86,7 @@ The `release.yml` assumes 6 secrets have been setup.
6986
- AWS_SECRET_ACCESS_KEY - AWS access secrets for programmatic access to AWS APIs.
7087
- AWS_REGION - default region for AWS API calls.
7188
- AWS_ECS_CLUSTER - Cluster name in ECS, this should match the value in your Userdata.
72-
- HOST_DOMAIN - Domain/submain of your application, eg `imgur.example.com` .
89+
- HOST_DOMAIN - Domain/sub-domain of your application, eg `imgur.example.com` .
7390
- LETSENCRYPT_EMAIL - Email address, required for Let's Encrypt automated TLS certificates.
7491

7592
These secrets are used to populate variables within GitHub Actions and other configuration files.

deploy/task-definition-template.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@
2929
{
3030
"name": "APP_VERSION",
3131
"value": "${RELEASE_VERSION}"
32+
},
33+
{
34+
"name": "VIRTUAL_PORT",
35+
"value": "5000"
3236
}
3337
],
3438
"mountPoints": [],

0 commit comments

Comments
 (0)