-
Notifications
You must be signed in to change notification settings - Fork 575
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
Added simple dockerfile and compose #59
base: main
Are you sure you want to change the base?
Conversation
* Support .env file * Fix default sub endpoint
* Setup migrations, misc tidy/fixes * Simplify migration provider
readme tweaks
* update README with instructions for the default URL * Update README.md --------- Co-authored-by: Daniel Holmgren <[email protected]>
* describeFeedGenerator route + multiple feeds * tweak readme
* describeFeedGenerator route + multiple feeds * tweak readme * improve env
* describeFeedGenerator route + multiple feeds * tweak readme * improve env * publish script * create -> put * readme * handle blob encoding * add check that feeds are available
So readers won't have to google Bluesky PDS to try to figure out what it means
(cherry picked from commit 1b2f04a)
* improve docs & helpers around publisher dids * add docs to env
Cosmetic: remove trailing space
Naive question: What does better control entail? |
I'm running the feed generator on my own server with lots of other stuff. If I instead of running yarn/node directly on the server but in a container I have more control of the security. Now if there is a security issue somewhere in the feed generator code, it will have impact on the container, not my server. |
Ah I see , thanks for this. I too have been running a feed generator on a VPS and have also experienced certain conflicts/issues from running yarn/node directly on the server. I think this PR would be helpful for running a feed generator and I think it'll make the process work the same way the PDS service does. |
Yes please! In particular this would make feeds more plug-n-play with services like Digitl Ocean's app platform. |
d36deef
to
fadd462
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor recommendations for the Dockerfile
and compose.yaml
FROM node:20-alpine | ||
|
||
WORKDIR /app | ||
COPY package.json . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
COPY package.json . | |
COPY package.json yarn.lock . |
WORKDIR /app | ||
COPY package.json . | ||
|
||
RUN yarn install |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RUN yarn install | |
RUN --mount=type=cache,target=/usr/local/share/.cache/yarn/v6 yarn install |
target=/root/.npm
for npm
https://docs.docker.com/reference/dockerfile/#example-cache-go-packages
|
||
# Bare neccesary | ||
COPY src/ ./src | ||
COPY .env . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
COPY .env . |
Some values in the .env
file might be secrets, so you should mount them at runtime instead of put them in the built and published image.
Using env_file
in the compose file instead.
image: feed | ||
ports: | ||
- "3000:3000" | ||
restart: unless-stopped |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
restart: unless-stopped | |
restart: unless-stopped | |
env_file: .env |
I wanted to run my feed as a docker service for better control.
Created a simple Dockerfile and a matching docker-compose.yml that seems to to the trick