-
Notifications
You must be signed in to change notification settings - Fork 23
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
failed to use unpublished( work-in-progressing) @atproto/api for ozone docker image, described hack in HACKING.md #87
Comments
I'm not sure we have ever had the need to build a Docker image against a patched version of the api package? I can see why that might be desirable in some cases, but might not be something we support or provide documentation for. |
@bnewbold I understand that your point. it maybe rare case. but it is good that regardless published or un-published, code can work on docker (in same manner). for example, when developing new feature of atproto having impact on API, it becomes hard to make integration test on docker with ozone aheading publish(i.e posting new PR). |
below Dockerfile and ops could involve work-in-progressing codes for ozone docker container.
# put this content as ozone/Dockerfile.dev
FROM node:20.11-alpine3.18
RUN npm install -g pnpm
RUN apk add --update dumb-init
# host side toplevel dir is ~/Documents/bluesky which has atproto and ozone folders, as described in HACKING.md
# based on atproto/services/bsky/Dockerfile >>>>
COPY ./atproto /usr/src/atproto
WORKDIR /usr/src/atproto
RUN pnpm install --frozen-lockfile; \
pnpm build;
RUN rm -rf node_modules; \
pnpm install --prod --shamefully-hoist --frozen-lockfile --prefer-offline > /dev/null
# based on ozone/Dockerfile >>>>
COPY ./ozone /usr/src/ozone
WORKDIR /usr/src/ozone
# for @atproto/api and @atproto/ozone, use work-in-progressing code as described in HACKING.md
RUN sed -i -r 's#"@atproto/(.+)": ".+"#"@atproto/\1": "link:../atproto/packages/\1/dist"#' ./package.json
RUN sed -i -r 's#"@atproto/(.+)": ".+"#"@atproto/\1": "link:../../atproto/packages/\1/dist"#' ./service/package.json
RUN yarn
RUN yarn build
RUN (cd service; yarn )
RUN cp -p /usr/src/atproto/packages/ozone/package.json /usr/src/atproto/packages/ozone/dist/package.json
RUN chown -R node:node /usr/src
EXPOSE 3000
ENV OZONE_PORT=3000
ENV NODE_ENV=production
USER node
CMD dumb-init -- node ./service
LABEL org.opencontainers.image.source=https://github.com/bluesky-social/ozone
LABEL org.opencontainers.image.description="Ozone Moderation Service Web UI"
LABEL org.opencontainers.image.licenses=MIT
# as described in HACKING.md
❯ cd ~/Documents/bluesky
❯ ls -l
drwxr-xr-x 22 user group 704 Jan 19 15:51 atproto
drwxr-xr-x 24 user group 768 Jan 24 19:17 ozone
❯ ls ozone/Dockerfile.dev
ozone/Dockerfile.dev
❯ docker build -f ozone/Dockerfile.dev -t ozone:dev .
:
ozone:
container_name: ozone
- image: ghcr.io/bluesky-social/ozone:0.1
+ image: ozone:dev |
HACKING.md describes how to use unpublished( work-in-progressing) atproto/api for ozone, in below section.
but this hack cannot use for building docker image as below error.
how can use unpublished atproto api in ozone docker image?
ozone/HACKING.md
Line 27 in 7963bec
ozone/HACKING.md
Lines 57 to 65 in 7963bec
The text was updated successfully, but these errors were encountered: