Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

docker changes #31

Merged
merged 9 commits into from
Jul 17, 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
28 changes: 28 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM elixir:1.14.5-otp-25 as builder

ENV MIX_ENV=prod

WORKDIR /explorer
COPY . .

RUN mix local.hex --force \
&& mix local.rebar --force \
&& mix archive.install --force hex phx_new \
&& mix deps.get --only $MIX_ENV \
&& mix deps.compile \
&& mix assets.deploy \
&& mix phx.digest \
&& mix compile \
&& mix release \
&& mix phx.gen.release

FROM elixir:1.14.5-otp-25
ENV MIX_ENV=prod

WORKDIR /explorer

COPY --from=builder /explorer/_build/$MIX_ENV/rel/starknet_explorer .

EXPOSE 4000

CMD ["/explorer/bin/starknet_explorer", "start"]
5 changes: 3 additions & 2 deletions config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,12 @@ if config_env() == :prod do
You can generate one by calling: mix phx.gen.secret
"""

host = System.get_env("PHX_HOST") || "example.com"
# host = System.get_env("PHX_HOST") || "example.com"
port = String.to_integer(System.get_env("PORT") || "4000")

config :starknet_explorer, StarknetExplorerWeb.Endpoint,
url: [host: host, port: 443, scheme: "https"],
server: true,
# url: [host: host, port: 443, scheme: "https"],
http: [
# Enable IPv6 and bind on all interfaces.
# Set it to {0, 0, 0, 0, 0, 0, 0, 1} for local network only access.
Expand Down
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
container_name: starknet_explorer_dev_db
image: postgres:15.3
ports:
- 127.0.0.1:5432:5432
- 5432:5432
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
Expand All @@ -25,9 +25,9 @@ services:
- [email protected]
- PGADMIN_DEFAULT_PASSWORD=pgadmin
ports:
- 127.0.0.1:5050:80
- 5050:80
volumes:
- 'pgadmin_data:/var/lib/pgadmin'
- pgadmin_data:/var/lib/pgadmin
networks:
default:
aliases:
Expand Down
Loading