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

Ghost 5 Dockerfile #100

Open
bird-in-hat opened this issue Jul 13, 2022 · 4 comments
Open

Ghost 5 Dockerfile #100

bird-in-hat opened this issue Jul 13, 2022 · 4 comments

Comments

@bird-in-hat
Copy link

I found out it works with ghost 5, but we have to upgrade packages aws-sdk and ghost-storage-base

FROM ghost:5.2.4-alpine AS ghost-base

RUN npm install --prefix /tmp/ghost-storage-adapter-s3 ghost-storage-adapter-s3 && \
    cp -r /tmp/ghost-storage-adapter-s3/node_modules/ghost-storage-adapter-s3 current/core/server/adapters/storage/s3 && \
    rm -r /tmp/ghost-storage-adapter-s3

RUN npm install ghost-storage-base && npm install aws-sdk
@mnebuerquo
Copy link

I'd add this to the end of your Dockerfile, because I was missing this and the default config doesn't enable the adapter:

ENV storage__active s3

That cost me a few hours. The readme documents the other environment vars for the adapter configuration, as well as the config showing storage.active field. But unless you specifically overwrite the default config in the Dockerfile to add storage.active, your adapter won't be enabled with just the env variables documented in the readme.

@lakshminarasimmanv
Copy link

ENV storage__active s3

Thanks! This works for me!

@laosb
Copy link

laosb commented Feb 18, 2023

I made a modernized TypeScript fork of this one, using latest v3 version of AWS SDK & modern async / await syntax, so the workaround of upgrading packages is no longer needed. Adding in @mnebuerquo's tip, a more complete Dockerfile for recent versions of Ghost would be:

FROM ghost:5.5.0-alpine AS ghost-base

RUN npm install --prefix /tmp/ghos3 ghos3 && \
    cp -r /tmp/ghos3/node_modules/ghos3 current/core/server/adapters/storage/s3 && \
    rm -r /tmp/ghos3

@imzedi
Copy link

imzedi commented Sep 25, 2024

@laosb I used the same as you have mentioned but its throwing me error ": Unable to find storage adapter s3 in ,/var/lib/ghost/content/adapters/,/var/lib/ghost/versions/5.94.2/core/server/adapters/"

I checked in my image there are files in current/core/server/adapters/storage/s3

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

No branches or pull requests

6 participants
@laosb @mnebuerquo @bird-in-hat @imzedi @lakshminarasimmanv and others