Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .dialyzer_ignore.exs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,5 @@
{"lib/philomena/static_pages.ex", :call_without_opaque},
{"lib/philomena/tags.ex", :call_without_opaque},
{"lib/philomena/topics.ex", :call_without_opaque},
{"lib/philomena/users.ex", :call_without_opaque},
{"lib/philomena/users/user.ex", :call_without_opaque},
{"lib/philomena_web/plugs/content_security_policy_plug.ex", :call_without_opaque}
{"lib/philomena/users.ex", :call_without_opaque}
]
7 changes: 0 additions & 7 deletions .dockerignore

This file was deleted.

9 changes: 7 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/cache@v4
- uses: actions/cache@v5
with:
path: |
_build
Expand All @@ -18,7 +18,12 @@ jobs:

- run: docker compose pull
- run: docker compose build
- run: ./scripts/philomena.sh test
- name: Run tests
run: ./scripts/philomena.sh test
# Artifacts from docker bind mount are owned by root, but cache action
# can only save artifacts running under the default user:
- name: Change artifact ownership for cache action
run: sudo chown -R $USER $GITHUB_WORKSPACE

typos:
name: 'Check for spelling errors'
Expand Down
18 changes: 7 additions & 11 deletions docker/app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,13 @@ RUN apk add \
openssh

# The default `cargo` and `rust` packages in Alpine repo don't include important
# rust dev components like `rust-src` (std lib sources), `rustfmt`, `clippy`, etc.
# In any case, it's much better to use rustup for rust toolchain management.
# Also, this lives in a separate RUN statement to cache this step separately, as
# it's quite slow to install.
RUN --mount=source=./scripts/lib.sh,target=./scripts/lib.sh \
--mount=source=./scripts/install/rust.sh,target=./scripts/install/rust.sh \
--mount=source=./rust-toolchain.toml,target=./rust-toolchain.toml \
./scripts/install/rust.sh

RUN --mount=source=./scripts,target=./scripts \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what the problem is with a build mount. This way scripts used only during build don't end up in the final image, which anyway uses a volume mount of the repo workspace at the same location and thus shadows these scripts

@liamwhite liamwhite Jun 7, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It comes from a previous attempt to use buildx with GHA cache in which having a build-time bind mount present completely prevents caching the layer (since the inputs to the build are no longer static and can't be digested)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense

./scripts/install/shellcheck.sh \
# components like `rust-src` (std lib sources), `rustfmt`, and `clippy`.
# It's also more conventional to use rustup for rust toolchain management.
COPY scripts scripts

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment above gives some reasoning to keep rust installation in a separate RUN statement. So let's either follow that comment or remove it as it became stale.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Edited the comment

COPY rust-toolchain.toml rust-toolchain.toml

RUN ./scripts/install/rust.sh \
&& ./scripts/install/shellcheck.sh \
&& ./scripts/install/typos.sh

# `/shell-history` dir is persisted across container rebuilds/restarts
Expand Down
4 changes: 4 additions & 0 deletions docker/app/Dockerfile.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
**
!docker/app/Dockerfile
!scripts
!rust-toolchain.toml
2 changes: 1 addition & 1 deletion docker/app/run-test
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ mix format --check-formatted
# if it's not done doing whatever it does yet
printf "Waiting for OpenSearch"

until wget -qO - opensearch:9200; do
until wget -qO - http://opensearch:9200; do
printf "."
sleep 2
done
Expand Down
5 changes: 5 additions & 0 deletions docker/mediaproc/Dockerfile.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
**
!docker/mediaproc/Dockerfile
!docker/mediaproc/safe-rsvg-convert
!native/philomena
native/philomena/target
2 changes: 2 additions & 0 deletions docker/web/Dockerfile.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
**
!docker/web/Dockerfile
6 changes: 5 additions & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ defmodule Philomena.MixProject do
start_permanent: Mix.env() == :prod,
aliases: aliases(),
deps: deps(),
dialyzer: [plt_add_apps: [:ex_unit, :mix]],
dialyzer: [
list_unused_filters: true,
ignore_warnings: ".dialyzer_ignore.exs",
plt_add_apps: [:ex_unit, :mix]
],
docs: [formatters: ["html"]],
listeners: [Phoenix.CodeReloader]
]
Expand Down
Loading