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

Docker packages setup #106

Merged
merged 10 commits into from
Jul 15, 2024
Merged

Docker packages setup #106

merged 10 commits into from
Jul 15, 2024

Conversation

facundoolano
Copy link
Owner

  • Tweaks the github action and dockerfile definitions to build and push to github packages when a version is tagged.
  • Adds some usage instructions in the readme to run both in development and production mode

@facundoolano
Copy link
Owner Author

@julienma following up here on the PR you've sent. I still need to fill in instructions so it's more obvious how to quickly try the app locally with the default feeds.

I could use some context regarding how do you plan to run this, to make sure the config isn't over complicated and to document in the README (eg. will you run with authentication enabled? is it reasonable to manually issue commands to setup the secret key of the app?)

cc @raynix since you've sent a similar PR.

@facundoolano facundoolano merged commit 4299f8f into main Jul 15, 2024
2 checks passed
@facundoolano facundoolano deleted the docker_image_debug branch July 15, 2024 19:55
@julienma
Copy link
Contributor

@facundoolano nice! Your instructions are pretty clear to me.

For context, I'm using docker compose files. Here's what I did:

  1. I switched my local build with your new image ghcr.io/facundoolano/feedi:latest, in default development environment. It works.
  2. I switched to production, and had to create a production.py file with the SECRET_KEY. It works fine. I'm wondering if it wouldn't be easier to set the secret as an env variable instead of fetching it from production.py, though I understand that it would probably make it harder when deploying without docker. I'm not sure.

Anyway, if you want to give an example docker compose file in your README, here's my minimal compose.yml:

version: "3.8"
services:
  feedi:
    restart: unless-stopped
    image: ghcr.io/facundoolano/feedi:latest
    environment:
      FLASK_ENV: production
    ports:
      - 9988:9988
    volumes:
      - ./instance:/app/instance
      - ./config/production.py:/app/feedi/config/production.py

@facundoolano
Copy link
Owner Author

facundoolano commented Jul 16, 2024

  1. I switched to production, and had to create a production.py file with the SECRET_KEY. It works fine. I'm wondering if it wouldn't be easier to set the secret as an env variable instead of fetching it from production.py, though I understand that it would probably make it harder when deploying without docker. I'm not sure.

Yes, this setup is overly complicated, I've been thinking how to improve it. My original intention was to make sure you couldn't start in prod mode without explicitly setting a SECRET_KEY, that's why I made production.py a hard requirement. But I think what I'll do instead is to make production.py optional, and check explicitly for SECRET_KEY, after loading all configuration sources.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants