Skip to content

Commit

Permalink
fix SPA routing
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixTJDietrich committed Aug 14, 2024
1 parent 00c6173 commit 6fa3a72
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions webapp/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ WORKDIR /app

COPY ./ /app/

# Ensure .env file exists
RUN touch .env

# Fix buggy replacement of COOLIFY_URL in .env
RUN COOLIFY_URL_VALUE=$(grep '^COOLIFY_URL=' .env | cut -d '=' -f2) && \
sed -i "s|\$COOLIFY_URL|$COOLIFY_URL_VALUE|g" .env
Expand All @@ -20,4 +23,6 @@ FROM nginx:latest

COPY --from=build /app/dist/webapp/browser /usr/share/nginx/html

COPY nginx.conf /etc/nginx/conf.d/default.conf

EXPOSE 80
11 changes: 11 additions & 0 deletions webapp/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
server {
listen 80;
listen [::]:80;
server_name localhost;

location / {
root /usr/share/nginx/html;
index index.html;
try_files $uri $uri/ /index.html =404;
}
}

0 comments on commit 6fa3a72

Please sign in to comment.