Skip to content
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

Fix static serving of favicons #625

Merged
merged 1 commit into from
Aug 5, 2023
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: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ ARG MIX_ENV=prod

ENV PHX_SERVER=true

USER nobody

COPY --from=elixir-builder --chown=nobody:nogroup /app /app

RUN mkdir -p /app/uploads
VOLUME /app/uploads

USER nobody

WORKDIR /app
ENTRYPOINT ["/app/bin/ambry"]
CMD ["start"]
1 change: 1 addition & 0 deletions lib/ambry_web.ex
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ defmodule AmbryWeb do
"""

def static_paths, do: ~w(assets favicon.svg favicon.png favicon-32x32.png favicon-96x96.png robots.txt)
def static_matching, do: ~w(assets favicon robots)

def router do
quote do
Expand Down
4 changes: 2 additions & 2 deletions lib/ambry_web/endpoint.ex
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ defmodule AmbryWeb.Endpoint do
plug Plug.Static,
at: "/",
from: :ambry,
gzip: false,
only: AmbryWeb.static_paths()
gzip: true,
only_matching: AmbryWeb.static_matching()

# Serve static user uploaded images
plug Plug.Static,
Expand Down