Hi everyone. I forked the docker ghost image and made a few changes for my project. When using docker run
I am getting the error ECONNREFUSED 127.0.0.1:3306
. Is there a specific way to start sqlite manually? I couldn’t find it in the Dockerfile provided but maybe I am missing some understanding as to how sqlite gets started. Here’s the modified Dockerfile: Thanks!
# https://docs.ghost.org/faq/node-versions/
# https://github.com/nodejs/LTS
FROM node:10-alpine
# grab su-exec for easy step-down from root
RUN apk add --no-cache 'su-exec>=0.2'
RUN apk add --no-cache \
# add "bash" for "[["
bash
ENV NODE_ENV production
ENV GHOST_VERSION 3.2.0
ENV GHOST_CLI_VERSION 1.13.1
#ghost config
ENV SQLITE_VER 4.1.1
ENV GHOST_INSTALL /var/lib/ghost
ENV GHOST_CONTENT /data/ghost_content
ENV paths__contentPath=${GHOST_CONTENT}
ENV database__connection__filename=${GHOST_CONTENT}/data/ghost-dev.db
RUN set -eux; \
npm install -g "ghost-cli@$GHOST_CLI_VERSION"; \
npm cache clean --force
RUN mkdir -p "$GHOST_CONTENT"; \
mkdir -p "$GHOST_INSTALL";
COPY ghost/content "$GHOST_CONTENT"
RUN set -eux; \
cd /tmp; \
chown node:node "$GHOST_INSTALL"; \
su-exec node ghost install "$GHOST_VERSION" --db sqlite3 --no-prompt --no-stack --no-setup --dir "$GHOST_INSTALL"; \
su-exec node yarn add "sqlite3@$SQLITE_VER" --force; \
apk add --no-cache --virtual .build-deps python make gcc g++ libc-dev; \
\
su-exec node yarn add "sqlite3@$SQLITE_VER" --force --build-from-source; \
\
apk del --no-network .build-deps; \
su-exec node yarn cache clean; \
su-exec node npm cache clean --force; \
npm cache clean --force; \
rm -rv /tmp/yarn* /tmp/v8*;
WORKDIR $GHOST_INSTALL
VOLUME $GHOST_CONTENT
COPY docker-entrypoint.sh /usr/local/bin
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["node", "${GHOST_INSTALL}/current/index.js"]
# docker exec -it mysql bash
EXPOSE 2368