Working on getting the dockerfile right

Replacement works, but not from the point of container start
This commit is contained in:
Jordan Roher 2023-04-20 16:42:30 -07:00
parent b18782a5fb
commit 0d7285dade
5 changed files with 9 additions and 2 deletions

View File

@ -9,6 +9,11 @@ COPY . .
ENV NODE_ENV production
ENV TITLE "My Website"
EXPOSE 4173
RUN sed -i -e 's/HTMLTITLE/'"${TITLE}"'/g' ./index.html
RUN sed -i -e 's/HTMLTITLE/'"${TITLE}"'/g' ./src/main.tsx
CMD ["npm", "run", "start"]

View File

@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" />
<title>Starbase 80</title>
<title>HTMLTITLE</title>
</head>
<body>
<div id="root"></div>

View File

@ -24,6 +24,8 @@ services:
image: jordanroher/starbase-80
ports:
- 4173:4173
environment:
- TITLE=My Homepage
volumes:
- ./config.json:/app/src/config.json
- ./icons:/app/public/icons # or wherever, JSON icon paths are relative to /app/public

View File

@ -5,6 +5,6 @@ import "./tailwind.css";
ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
<React.StrictMode>
<IndexPage title="Starbase 80" icon="/logo.png" />
<IndexPage title="HTMLTITLE" icon="/logo.png" />
</React.StrictMode>
);