|
2 | 2 |
|
3 | 3 | [](https://portal.defang.dev/redirect?url=https%3A%2F%2Fgithub.com%2Fnew%3Ftemplate_name%3Dsample-imgproxy-template%26template_owner%3DDefangSamples)
|
4 | 4 |
|
5 |
| -ImgProxy is a fast and secure standalone server for resizing and converting remote images. It can be deployed using the official Docker image, as documented [here](https://docs.imgproxy.net/installation#docker). |
| 5 | +This sample shows how to deploy ImgProxy with Defang. ImgProxy is a fast and secure standalone server for resizing and converting remote images. It can be deployed using the official Docker image, as documented [here](https://docs.imgproxy.net/installation#docker). |
6 | 6 |
|
7 | 7 | ## Prerequisites
|
8 | 8 |
|
9 |
| -Install the Defang CLI by following the instructions in the [Defang CLI documentation](https://docs.defang.io/docs/getting-started). |
| 9 | +1. Download [Defang CLI](https://github.com/DefangLabs/defang) |
| 10 | +2. (Optional) If you are using [Defang BYOC](https://docs.defang.io/docs/concepts/defang-byoc) authenticate with your cloud provider account |
| 11 | +3. (Optional for local development) [Docker CLI](https://docs.docker.com/engine/install/) |
10 | 12 |
|
11 |
| -## Build and run the application |
| 13 | +## Development |
12 | 14 |
|
13 |
| -If you have environment variables configured for your [own cloud account](https://docs.defang.io/docs/concepts/defang-byoc), this will deploy the application to your cloud account, otherwise it will deploy to the Defang cloud. |
| 15 | +To run the application locally, you can use the following command: |
14 | 16 |
|
15 |
| -```sh |
| 17 | +```bash |
| 18 | +docker compose up --build |
| 19 | +``` |
| 20 | + |
| 21 | +## Configuration |
| 22 | + |
| 23 | +For this sample, you will not need to provide [configuration](https://docs.defang.io/docs/concepts/configuration). |
| 24 | + |
| 25 | +If you wish to provide configuration, see below for an example of setting a configuration for a value named `API_KEY`. |
| 26 | + |
| 27 | +```bash |
| 28 | +defang config set API_KEY |
| 29 | +``` |
| 30 | + |
| 31 | +## Deployment |
| 32 | + |
| 33 | +> [!NOTE] |
| 34 | +> Download [Defang CLI](https://github.com/DefangLabs/defang) |
| 35 | +
|
| 36 | +### Defang Playground |
| 37 | + |
| 38 | +Deploy your application to the Defang Playground by opening up your terminal and typing: |
| 39 | +```bash |
16 | 40 | defang compose up
|
17 | 41 | ```
|
18 | 42 |
|
| 43 | +### BYOC (AWS) |
| 44 | + |
| 45 | +If you want to deploy to your own cloud account, you can use Defang BYOC: |
| 46 | + |
| 47 | +1. [Authenticate your AWS account](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html), and check that you have properly set your environment variables like `AWS_PROFILE`, `AWS_REGION`, `AWS_ACCESS_KEY_ID`, and `AWS_SECRET_ACCESS_KEY`. |
| 48 | +2. Run in a terminal that has access to your AWS environment variables: |
| 49 | + ```bash |
| 50 | + defang --provider=aws compose up |
| 51 | + ``` |
| 52 | + |
19 | 53 | ---
|
20 | 54 |
|
21 | 55 | Title: ImgProxy
|
|
0 commit comments