Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include config file as part of app binary #270

Closed
sidoki opened this issue Dec 29, 2023 · 3 comments
Closed

Include config file as part of app binary #270

sidoki opened this issue Dec 29, 2023 · 3 comments

Comments

@sidoki
Copy link

sidoki commented Dec 29, 2023

Description

In order to provide deployment consistency, we need to include configuration files as part of the application binary, especially during app deployment to avoid unintented changes made from the config file if copied manually.

To Reproduce

Currently we need to copy paste the app binary and config files separately.

Expected Behavior

When building the app, the configuration files will be included as part of the binary. Hence, the user just need to copy the binary to deployment env.

Environment:

Additional Context

@kaplanelad
Copy link
Contributor

Consideration of the issue led me to the following proposal:

  • Create a new configuration file named imbede.yaml, for example.
    The YAML should be like this:
development:
   ....
production:
  ....
custom-env:
  ....
  • During the build process, load this file if it exists at a cost.
  • At the runtime, if Loco builds with imbede.yaml points the configuration only to this file content

@jondot any other thoughts?

@tjyang
Copy link
Contributor

tjyang commented Dec 29, 2023

For my understanding, This request is more like this one at rust-cli/config-rs#408
End goal is to have myapp2-cli has at least config/production.yaml and and some files under frontend/* embeded inside the binary.

[me@rocky9t01a myapp2]$ tree -L 2
.
<snipped>
├── config
│   ├── development.yaml
│   ├── production.yaml
│   └── test.yaml
├── db.sqlite
├── examples
│   └── playground.rs
├── frontend
│   ├── dist
│   ├── favicon.ico
│   ├── index.html
│   ├── package.json
│   ├── pnpm-lock.yaml
│   ├── README.md
│   ├── src
│   └── vite.config.js
<snipped>

20 directories, 20 files
[me@rocky9t01a myapp2]$


@jondot
Copy link
Contributor

jondot commented Dec 31, 2023

@jurukode i'm not sure about config files being embedded yet, because they are config files -- they are supposed to be changed/tweaked/etc.

I believe your pain point is a single "deliverable", which you can get with a docker container.

Just to reiterate -- I think embedding is cool, but i'm not sure its what most people would expect.

@loco-rs loco-rs locked and limited conversation to collaborators Dec 31, 2023
@jondot jondot converted this issue into discussion #286 Dec 31, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants