|
4 | 4 |
|
5 | 5 | This template is a member list project developed using Ruby on Rails, offering a starting point to help you quickly build your team management system. We have prepared all the essential files for deployment. By spending less than 10 minutes setting up the environment, as detailed in the prerequisites, and executing the commands in our step-by-step guide, your website will be ready to go live to the world!
|
6 | 6 |
|
7 |
| -## NOTE |
8 |
| - |
9 |
| -This sample showcases how you could deploy a full-stack application with Defang in Ruby on Rails. However, it uses a SQLite database, which isn't production-ready and will be reset with every deployment. For production use cases you should use a managed database like RDS, Aiven, or others. If you stick to Rail's default SQLite database, your stored data will be lost on every deployment, and in some other cases. In the future, Defang will help you provision and connect to managed databases. |
10 |
| - |
11 | 7 | ## Essential Setup Files
|
12 | 8 |
|
13 | 9 | 1. A [Dockerfile](https://docs.docker.com/develop/develop-images/dockerfile_best-practices/) to describe the basic image of your applications.
|
14 | 10 | 2. A [docker-compose file](https://docs.defang.io/docs/concepts/compose) to define and run multi-container Docker applications.
|
15 | 11 | 3. A [.dockerignore](https://docs.docker.com/build/building/context/#dockerignore-files) file to comply with the size limit (10MB).
|
16 | 12 |
|
17 |
| -## Prerequisite |
| 13 | +## Development Using [Dev Containers](https://containers.dev/) |
| 14 | + |
| 15 | +1. Open the working directory with Visual Studio Code or any editor which supports Dev Containers. |
| 16 | +2. Click on the bottom left corner of the window where you see "Reopen in Container". |
| 17 | +3. Open up a shell in the VS Code terminal and run `docker compose -f compose.dev.yaml up`. |
| 18 | + |
| 19 | + |
| 20 | +## Configuration |
| 21 | + |
| 22 | +For this sample, you will need to provide the following [configuration](https://docs.defang.io/docs/concepts/configuration). Note that if you are using the 1-click deploy option, you can set these values as secrets in your GitHub repository and the action will automatically deploy them for you. |
| 23 | + |
| 24 | +### `POSTGRES_PASSWORD` |
| 25 | +This password will be used to initialize the PostgreSQL database and to connect to it. |
18 | 26 |
|
19 |
| -1. Download [Defang CLI](https://github.com/DefangLabs/defang) |
20 |
| -2. If you are using [Defang BYOC](https://docs.defang.io/docs/concepts/defang-byoc), make sure you have properly [authenticated your AWS account](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) |
21 |
| -3. Plus, make sure that you have properly set your environment variables like `AWS_PROFILE`, `AWS_REGION`, `AWS_ACCESS_KEY_ID`, and `AWS_SECRET_ACCESS_KEY`. |
22 | 27 |
|
23 | 28 | ## Deployment
|
24 | 29 |
|
25 |
| -1. Open the terminal and type `defang login` |
26 |
| -2. Type `defang compose up` in the CLI |
27 |
| -3. Now your application will be launched |
| 30 | +> [!NOTE] |
| 31 | +> Download [Defang CLI](https://github.com/DefangLabs/defang) |
| 32 | +
|
| 33 | +### Defang Playground |
| 34 | + |
| 35 | +Deploy your application to the defang playground by opening up your terminal and typing `defang up`. |
| 36 | + |
| 37 | +### BYOC (AWS) |
| 38 | + |
| 39 | +If you want to deploy to your own cloud account, you can use Defang BYOC: |
| 40 | + |
| 41 | +1. [Authenticate your AWS account](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html), and that you have properly set your environment variables like `AWS_PROFILE`, `AWS_REGION`, `AWS_ACCESS_KEY_ID`, and `AWS_SECRET_ACCESS_KEY`. |
28 | 42 |
|
29 | 43 | ---
|
30 | 44 |
|
|
0 commit comments