Skip to content

Commit 28e55f8

Browse files
committed
Add basic homepage
1 parent c3e77c5 commit 28e55f8

File tree

14 files changed

+414
-22
lines changed

14 files changed

+414
-22
lines changed

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ RUN groupadd --gid $USER_GID $USERNAME \
3737

3838
# install base dependencies
3939
RUN apt-get update -y && \
40-
apt-get install -y build-essential git inotify-tools libstdc++6 openssl libncurses5 locales ca-certificates && \
40+
apt-get install -y curl build-essential git inotify-tools libstdc++6 openssl libncurses5 locales ca-certificates && \
4141
apt-get clean && \
4242
rm -rf /var/lib/apt/lists/*_*
4343

Dockerfile.pgadmin

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
FROM dpage/pgadmin4:8.2
2+
3+
# These defaults are overridden in the docker-compose.yaml
4+
ENV POSTGRES_USER=postgres \
5+
POSTGRES_DB=wfloat-local \
6+
POSTGRES_PORT=5432 \
7+
POSTGRES_SERVICE_NAME=postgres
8+
9+
# Switch to root user to gain write access
10+
USER root
11+
12+
# Create the servers.json file
13+
RUN echo "{\
14+
\"Servers\": {\
15+
\"1\": {\
16+
\"Name\": \"$POSTGRES_DB\",\
17+
\"Group\": \"Servers\",\
18+
\"Port\": $POSTGRES_PORT,\
19+
\"Username\": \"$POSTGRES_USER\",\
20+
\"Host\": \"$POSTGRES_SERVICE_NAME\",\
21+
\"SSLMode\": \"prefer\",\
22+
\"MaintenanceDB\": \"postgres\"\
23+
}\
24+
}\
25+
}" > /pgadmin4/servers.json
26+
27+
# Switch back to default user
28+
USER pgadmin
29+
30+
ENTRYPOINT ["/entrypoint.sh"]

assets/css/app.css

+16
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,19 @@
33
@import "tailwindcss/utilities";
44

55
/* This file is for your main application CSS */
6+
7+
.tts-container {
8+
/* background-color: orange; */
9+
display: flex;
10+
flex-direction: column;
11+
justify-content: center;
12+
}
13+
14+
.audio-container {
15+
width: 100%;
16+
/* background-color: orange; */
17+
display: flex;
18+
flex-direction: column;
19+
/* justify-content: center; */
20+
align-items: center;
21+
}

config/runtime.exs

+7-7
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ if config_env() == :prod do
5555
# To get SSL working, you will need to add the `https` key
5656
# to your endpoint configuration:
5757

58-
config :wfloat, WfloatWeb.Endpoint,
59-
https: [
60-
port: 443,
61-
cipher_suite: :strong,
62-
keyfile: System.get_env("SSL_KEY_PATH"),
63-
certfile: System.get_env("SSL_CERT_PATH")
64-
]
58+
# config :wfloat, WfloatWeb.Endpoint,
59+
# https: [
60+
# port: 443,
61+
# cipher_suite: :strong,
62+
# keyfile: System.get_env("SSL_KEY_PATH"),
63+
# certfile: System.get_env("SSL_CERT_PATH")
64+
# ]
6565
#
6666
# The `cipher_suite` is set to `:strong` to support only the
6767
# latest and more secure SSL ciphers. This means old browsers

docker-compose.yaml

+116-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
1+
# https://github.com/BretFisher/node-docker-good-defaults/blob/main/docker-compose.yml
12
version: '3.8'
23

4+
x-function: &rvc-common-settings
5+
image: mitchsayre/rvc:latest
6+
deploy:
7+
resources:
8+
reservations:
9+
devices:
10+
- driver: nvidia
11+
count: 1
12+
capabilities: [ gpu ]
13+
314
services:
415
web:
516
build:
@@ -8,8 +19,110 @@ services:
819
environment:
920
- SECRET_KEY_BASE=${SECRET_KEY_BASE}
1021
- PORT=${PORT}
11-
- SSL_KEY_PATH=${SSL_KEY_PATH}
12-
- SSL_CERT_PATH=${SSL_CERT_PATH}
13-
- PHX_HOST=${PHX_HOST}
22+
# - SSL_KEY_PATH=${SSL_KEY_PATH}
23+
# - SSL_CERT_PATH=${SSL_CERT_PATH}
24+
# - PHX_HOST=${PHX_HOST}
1425
ports:
1526
- 4001:4001
27+
network_mode: host
28+
depends_on:
29+
- api
30+
31+
api:
32+
build:
33+
context: ../api
34+
dockerfile: ../api/Dockerfile
35+
environment:
36+
- POSTGRES_CONNECTION_URL=${POSTGRES_CONNECTION_URL}
37+
- POSTGRES_USER=${POSTGRES_USER}
38+
- POSTGRES_DB=${POSTGRES_DB}
39+
- POSTGRES_PW=${POSTGRES_PW}
40+
- POSTGRES_PORT=${POSTGRES_PORT}
41+
- POSTGRES_SERVICE_NAME=${POSTGRES_SERVICE_NAME}
42+
- AWS_REGION=${AWS_REGION}
43+
- AWS_SPEECH_BUCKET_NAME=${AWS_SPEECH_BUCKET_NAME}
44+
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
45+
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
46+
47+
ports:
48+
- 4000:4000
49+
network_mode: host
50+
volumes:
51+
- /usr/src/api/node_modules
52+
depends_on:
53+
- postgres
54+
- pgadmin
55+
- tts
56+
- rvc0
57+
- rvc1
58+
- rvc2
59+
60+
postgres:
61+
container_name: postgres
62+
image: postgres:16.1
63+
environment:
64+
- POSTGRES_USER=${POSTGRES_USER}
65+
- POSTGRES_PASSWORD=${POSTGRES_PW}
66+
- POSTGRES_DB=${POSTGRES_DB}
67+
ports:
68+
- "5432:5432"
69+
volumes:
70+
- postgres-data:/var/lib/postgresql/data
71+
restart: always
72+
73+
pgadmin:
74+
build:
75+
context: .
76+
dockerfile: Dockerfile.pgadmin
77+
environment:
78+
- POSTGRES_USER=${POSTGRES_USER}
79+
- POSTGRES_DB=${POSTGRES_DB}
80+
- POSTGRES_PORT=5432
81+
- POSTGRES_SERVICE_NAME=${POSTGRES_SERVICE_NAME}
82+
- PGADMIN_DEFAULT_EMAIL=${PGADMIN_EMAIL}
83+
- PGADMIN_DEFAULT_PASSWORD=${PGADMIN_PW}
84+
ports:
85+
- '5050:80'
86+
restart: always
87+
depends_on:
88+
- postgres
89+
90+
tts:
91+
container_name: tts
92+
image: mitchsayre/tts:latest
93+
environment:
94+
- AZURE_SPEECH_KEY=${AZURE_SPEECH_KEY}
95+
- AZURE_SPEECH_REGION=${AZURE_SPEECH_REGION}
96+
ports:
97+
- 5379:5379
98+
99+
rvc0:
100+
<<: *rvc-common-settings
101+
container_name: rvc0
102+
volumes:
103+
- ../packages/rvc-gradio-server/shared/weights:/app/assets/weights
104+
- ../packages/rvc-gradio-server/shared:/app/shared
105+
- ../packages/rvc-gradio-server/tmp/rvc0:/tmp/gradio
106+
ports:
107+
- 7865:7865
108+
rvc1:
109+
<<: *rvc-common-settings
110+
container_name: rvc1
111+
volumes:
112+
- ../packages/rvc-gradio-server/shared/weights:/app/assets/weights
113+
- ../packages/rvc-gradio-server/shared:/app/shared
114+
- ../packages/rvc-gradio-server/tmp/rvc1:/tmp/gradio
115+
ports:
116+
- 7866:7865
117+
rvc2:
118+
<<: *rvc-common-settings
119+
container_name: rvc2
120+
volumes:
121+
- ../packages/rvc-gradio-server/shared/weights:/app/assets/weights
122+
- ../packages/rvc-gradio-server/shared:/app/shared
123+
- ../packages/rvc-gradio-server/tmp/rvc2:/tmp/gradio
124+
ports:
125+
- 7867:7865
126+
127+
volumes:
128+
postgres-data:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
defmodule Wfloat.Text_to_speeches.TextToSpeech do
2+
use Ecto.Schema
3+
import Ecto.Changeset
4+
5+
schema "text_to_speeches" do
6+
field :voiceModelId, :string
7+
field :inputText, :string
8+
field :authHeader, :string
9+
10+
timestamps(type: :utc_datetime)
11+
end
12+
13+
@doc false
14+
def changeset(text_to_speech, attrs) do
15+
text_to_speech
16+
|> cast(attrs, [:voiceModelId, :inputText, :authHeader])
17+
|> validate_required([:voiceModelId, :inputText, :authHeader])
18+
end
19+
end

lib/wfloat_web/components/layouts/app.html.heex

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@
99
</p>
1010
</div>
1111
<div class="flex items-center gap-4 font-semibold leading-6 text-zinc-900">
12-
<a href="https://twitter.com/elixirphoenix" class="hover:text-zinc-700">
12+
<%!-- <a href="https://twitter.com/elixirphoenix" class="hover:text-zinc-700">
1313
@elixirphoenix
14-
</a>
15-
<a href="https://github.com/phoenixframework/phoenix" class="hover:text-zinc-700">
14+
</a> --%>
15+
<a href="https://github.com/orgs/wfloat/repositories" class="hover:text-zinc-700">
1616
GitHub
1717
</a>
18-
<a
18+
<%!-- <a
1919
href="https://hexdocs.pm/phoenix/overview.html"
2020
class="rounded-lg bg-zinc-100 px-2 py-1 hover:bg-zinc-200/80"
2121
>
2222
Get Started <span aria-hidden="true">&rarr;</span>
23-
</a>
23+
</a> --%>
2424
</div>
2525
</div>
2626
</header>

lib/wfloat_web/controllers/page_controller.ex

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ defmodule WfloatWeb.PageController do
44
def home(conn, _params) do
55
# The home page is often custom made,
66
# so skip the default app layout.
7-
render(conn, :home, layout: false)
7+
redirect(conn, to: Routes.live_path(conn, WfloatWeb.CreateTTSLive, %{}))
88
end
99
end

lib/wfloat_web/controllers/page_html/home.html.heex

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<.flash_group flash={@flash} />
1+
<%!-- <.flash_group flash={@flash} />
22
<div class="left-[40rem] fixed inset-y-0 right-0 z-0 hidden lg:block xl:left-[50rem]">
33
<svg
44
viewBox="0 0 1480 957"
@@ -219,4 +219,4 @@
219219
</div>
220220
</div>
221221
</div>
222-
</div>
222+
</div> --%>

0 commit comments

Comments
 (0)