Web Client #11

Merged
Simponic merged 19 commits from web into main 2023-01-19 16:04:10 -05:00
5 changed files with 15 additions and 6 deletions
Showing only changes of commit 390db1128b - Show all commits

View File

@ -71,4 +71,7 @@ COPY --from=builder --chown=nobody:root /app/priv /app/priv
USER nobody USER nobody
EXPOSE 8080
EXPOSE 34355
CMD /app/bin/chessh eval "Chessh.Release.migrate" && /app/bin/chessh start CMD /app/bin/chessh eval "Chessh.Release.migrate" && /app/bin/chessh start

View File

@ -4,7 +4,8 @@ datestamp=$(date +%Y%m%d-%H%M)
env_file=.env.prod env_file=.env.prod
project_name=chessh project_name=chessh
port=8080 port=8080
host=127.0.0.1 ssh_port=34355
host=0.0.0.0
container_names=("chessh-database" "chessh-server" "chessh-frontend") container_names=("chessh-database" "chessh-server" "chessh-frontend")
@ -39,6 +40,7 @@ docker run \
--env-file $env_file \ --env-file $env_file \
--network $project_name \ --network $project_name \
--name $project_name-server \ --name $project_name-server \
--publish "${host}:${ssh_port}:${ssh_port}/tcp" \
--net-alias server \ --net-alias server \
chessh/server chessh/server

View File

@ -20,7 +20,7 @@ RUN npm run build
FROM nginx:alpine FROM nginx:alpine
EXPOSE 80 EXPOSE 80
COPY nginx.conf /etc/nginx/conf.d/ COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build /usr/app/build /usr/share/nginx/html COPY --from=build /usr/app/build /usr/share/nginx/html
RUN chown -R nginx:nginx /usr/share/nginx/html RUN chown -R nginx:nginx /usr/share/nginx/html

View File

@ -1,3 +1,7 @@
upstream server {
server server:8080;
}
server { server {
listen 80; listen 80;
@ -7,7 +11,8 @@ server {
try_files $uri $uri/ /index.html; try_files $uri $uri/ /index.html;
} }
location ~ ^/api(/.*|$) { location /api/ {
proxy_pass http://server:8080/$1; proxy_set_header Host $host;
proxy_pass http://server/;
} }
} }

View File

@ -5,8 +5,7 @@ import logo from "./assets/chessh_sm.svg";
import { useAuthContext } from "./context/auth_context"; import { useAuthContext } from "./context/auth_context";
export const Root = () => { export const Root = () => {
const { signedIn, setUserId, setSignedIn, setSessionOver, signOut } = const { signedIn, signOut } = useAuthContext();
useAuthContext();
return ( return (
<> <>