- 
                Notifications
    You must be signed in to change notification settings 
- Fork 796
FEATURE: introduce web_only images #966
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
|  | @@ -92,7 +92,6 @@ RUN --mount=type=tmpfs,target=/var/log \ | |
| sh -c "test -f /sbin/initctl || ln -s /bin/true /sbin/initctl"; \ | ||
| apt-get -y update && DEBIAN_FRONTEND=noninteractive apt-get -y install runit socat \ | ||
| libpq-dev postgresql-client-${PG_MAJOR} \ | ||
| postgresql-${PG_MAJOR} postgresql-contrib-${PG_MAJOR} postgresql-${PG_MAJOR}-pgvector \ | ||
| nodejs yarn &&\ | ||
| mkdir -p /etc/runit/1.d | ||
|  | ||
|  | @@ -130,7 +129,6 @@ ADD install-jemalloc /tmp/install-jemalloc | |
| RUN /tmp/install-jemalloc | ||
|  | ||
| ADD install-redis /tmp/install-redis | ||
| RUN /tmp/install-redis | ||
|  | ||
| ADD install-oxipng /tmp/install-oxipng | ||
| RUN /tmp/install-oxipng | ||
|  | @@ -145,14 +143,6 @@ RUN gem install pups --force &&\ | |
| ADD thpoff.c /src/thpoff.c | ||
| RUN gcc -o /usr/local/sbin/thpoff /src/thpoff.c && rm /src/thpoff.c | ||
|  | ||
| # clean up for docker squash | ||
| There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We no longer use docker squash - that has been gone for a long time. Here, we now desire /tmp to stick around as a way of keeping /tmp/install-redis around for installing later within a build for discourse-dev. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if we could delete these after the  There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The other option we have is to add a tmpfs have a for these during the build. Note that I'm keeping /tmp around to ensure install-redis remains as needed - it's called in both this image as well as the dev image. | ||
| RUN rm -fr /usr/local/share/doc &&\ | ||
| rm -fr /usr/local/share/ri &&\ | ||
| rm -fr /var/lib/apt/lists/* &&\ | ||
| rm -fr /root/.gem &&\ | ||
| rm -fr /root/.npm &&\ | ||
| rm -fr /tmp/* | ||
|  | ||
| # this is required for aarch64 which uses buildx | ||
| # see https://github.com/docker/buildx/issues/150 | ||
| RUN rm -f /etc/service | ||
|  | @@ -168,7 +158,7 @@ RUN install -dm 0755 -o discourse -g discourse /var/www/discourse &&\ | |
| sudo -u discourse git clone --branch $DISCOURSE_BRANCH --filter=tree:0 https://github.com/discourse/discourse.git /var/www/discourse &&\ | ||
| gem install bundler --conservative -v $(awk '/BUNDLED WITH/ { getline; gsub(/ /,""); print $0 }' /var/www/discourse/Gemfile.lock) | ||
|  | ||
| FROM discourse_slim AS discourse_release | ||
| FROM discourse_slim AS discourse_web_only | ||
| ENV RAILS_ENV=production | ||
|  | ||
| RUN cd /var/www/discourse &&\ | ||
|  | @@ -181,3 +171,9 @@ RUN cd /var/www/discourse &&\ | |
|  | ||
| RUN cd /var/www/discourse &&\ | ||
| sudo -u discourse /bin/bash -c 'if [ -f yarn.lock ]; then yarn install --frozen-lockfile && yarn cache clean; else pnpm install --frozen-lockfile; fi' | ||
|  | ||
| FROM discourse_web_only AS discourse_release | ||
| RUN --mount=type=tmpfs,target=/var/log \ | ||
| apt-get -y update && DEBIAN_FRONTEND=noninteractive apt-get -y install \ | ||
| postgresql-${PG_MAJOR} postgresql-contrib-${PG_MAJOR} postgresql-${PG_MAJOR}-pgvector | ||
| RUN /tmp/install-redis | ||
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.
This can be moved too.
Uh oh!
There was an error while loading. Please reload this page.
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.
We'd need a way to add it to the dev image as well when we build that, as that also needs to be able to run install-redis in a different context.
My concern with copying is that any changes to install-redis could get out of sync in an update.
Probably a preferred solution or way forward that would allow is to give a shared context, IE reorganize things so all dockerfiles live under a common directory.
base.dockerfiledev.dockerfiletest.dockerfileetc. but I'd prefer that reorganization be left for a potential future refactor stage.