Skip to content
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

Dockerize and deploy #2

Open
stifskere opened this issue Nov 12, 2024 · 4 comments
Open

Dockerize and deploy #2

stifskere opened this issue Nov 12, 2024 · 4 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@stifskere
Copy link
Member

stifskere commented Nov 12, 2024

This issue is probably not doable yet, but it's still left here for when it is.

The objective is to dockerize the whole project in a single container, both front end and back end, since deno can generate static files and rust can too, a single container should be enough to run the binaries and an nginx instance that has a configuration where / goes to the front end and /api gets rewritten to / but instead of sending the request to 5173 the server redirects that to 5174 which is the back end exposed port.

image

The backend binary requires one or more arguments, you can pass as many as you want of --source which are files with a JSON array in the following format

[
  {
    "source": "url to the source",
    "headers": {} // all the headers in form of a javascript object for your source
  }
]
@stifskere stifskere converted this from a draft issue Nov 12, 2024
@SergioRibera SergioRibera added enhancement New feature or request good first issue Good for newcomers labels Nov 12, 2024
@stifskere
Copy link
Member Author

We are working on this in the Docker branch the docker builds and runs both services, but a bug referenced in #3 won't let the deploy continue, I decided to upload the sources, before making any change to the database the target must be prepared with cargo sqlx prepare, the .sqlx folder is checked into version control and there is a required API key before deploying which is the STRIPE_SECRET, you may pass it to docker-compose build before deploying.

Since this project contains that private key it shouldn't be published to a public registry, as it might affect that key security.

The many times this key "has been leaked" don't really matter as these test keys are reset every day, and about the database password which is my personal password doesn't really affect me since I only use that in local, development and so...

@stifskere
Copy link
Member Author

stifskere commented Nov 24, 2024

I will continue working on this issue. The other one has been solved already.

@stifskere stifskere self-assigned this Nov 24, 2024
@SergioRibera
Copy link
Member

I think its solved in #6 right?

@stifskere
Copy link
Member Author

I think its solved in #6 right?

The deployment is solved, but the page doesn't handle environment variables well, in fact it is deployed at rlarndg.rustlang-es.org, except it is not working there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
Status: Todo
Development

No branches or pull requests

2 participants