remove selfhost.sh and fix Dockerfile
This commit is contained in:
@ -11,12 +11,12 @@ COPY tsconfig.json .
|
||||
COPY .prettierrc .
|
||||
COPY .eslintrc .
|
||||
|
||||
COPY /self-hosting/selfhost.sh /app/selfhost.sh
|
||||
COPY /packages/readabilityjs/package.json ./packages/readabilityjs/package.json
|
||||
COPY /packages/api/package.json ./packages/api/package.json
|
||||
COPY /packages/text-to-speech/package.json ./packages/text-to-speech/package.json
|
||||
COPY /packages/content-handler/package.json ./packages/content-handler/package.json
|
||||
COPY /packages/db/package.json ./packages/db/package.json
|
||||
COPY /packages/liqe/package.json ./packages/liqe/package.json
|
||||
|
||||
RUN yarn install --pure-lockfile
|
||||
|
||||
@ -25,9 +25,11 @@ COPY /packages/api ./packages/api
|
||||
COPY /packages/text-to-speech ./packages/text-to-speech
|
||||
COPY /packages/content-handler ./packages/content-handler
|
||||
COPY /packages/db ./packages/db
|
||||
COPY /packages/liqe ./packages/liqe
|
||||
|
||||
RUN yarn workspace @omnivore/text-to-speech-handler build
|
||||
RUN yarn workspace @omnivore/content-handler build
|
||||
RUN yarn workspace @omnivore/liqe build
|
||||
RUN yarn workspace @omnivore/api build
|
||||
|
||||
RUN rm -rf /app/packages/api/node_modules
|
||||
@ -50,14 +52,11 @@ COPY --from=builder /app/node_modules /app/node_modules
|
||||
COPY --from=builder /app/package.json /app/package.json
|
||||
COPY --from=builder /app/packages/text-to-speech/ /app/packages/text-to-speech/
|
||||
COPY --from=builder /app/packages/content-handler/ /app/packages/content-handler/
|
||||
COPY --from=builder /app/packages/liqe/ /app/packages/liqe/
|
||||
COPY --from=builder /app/packages/db/ /app/packages/db/
|
||||
COPY --from=builder /app/selfhost.sh /app/selfhost.sh
|
||||
|
||||
RUN apk add --no-cache postgresql-client
|
||||
RUN chmod 0755 /app/selfhost.sh
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
# Using a custom script to customize imageproxy startup and to pass
|
||||
# signatureKey through env variable
|
||||
ENTRYPOINT ["/app/selfhost.sh"]
|
||||
CMD ["yarn", "workspace", "@omnivore/api", "start"]
|
||||
|
||||
@ -1,16 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "creating omnivore database with $(which psql) and user: $POSTGRES_USER"
|
||||
psql --host $PG_HOST -c "CREATE DATABASE omnivore;"
|
||||
|
||||
echo "creating app_user"
|
||||
psql --host $PG_HOST -d $PG_DB -c "CREATE USER app_user WITH ENCRYPTED PASSWORD '$PG_PASSWORD';"
|
||||
echo "created app_user"
|
||||
|
||||
echo "running migrations as $POSTGRES_USER"
|
||||
PG_USER=$POSTGRES_USER PG_PASSWORD=$POSTGRES_PASSWORD yarn workspace @omnivore/db migrate
|
||||
|
||||
psql --host $PG_HOST -d $PG_DB -c "GRANT omnivore_user TO app_user;"
|
||||
echo "granted omnivore_user to app_user"
|
||||
|
||||
yarn workspace @omnivore/api start
|
||||
Reference in New Issue
Block a user