Skip to content

Commit 27467e6

Browse files
Merge branch 'main' into frontend/unity-auth
2 parents d803fb1 + c3a718a commit 27467e6

File tree

6 files changed

+75
-6
lines changed

6 files changed

+75
-6
lines changed

FrontendDockerfile

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Build the frontend and serve with nginx
2+
FROM node:18
3+
4+
COPY frontend frontend
5+
WORKDIR frontend
6+
RUN npm install && npm run build
7+
8+
FROM nginx:1.24.0-alpine
9+
10+
COPY --from=0 /frontend/build /usr/share/nginx/html
11+
COPY nginx-default.conf /etc/nginx/conf.d/default.conf

frontend/package-lock.json

+10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"devDependencies": {
1818
"@playwright/test": "^1.28.1",
1919
"@sveltejs/adapter-auto": "^3.0.0",
20+
"@sveltejs/adapter-static": "^3.0.1",
2021
"@sveltejs/kit": "^2.0.0",
2122
"@sveltejs/vite-plugin-svelte": "^3.0.0",
2223
"@tailwindcss/forms": "^0.5.7",

frontend/src/routes/+layout.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const ssr = false;

frontend/svelte.config.js

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1-
import adapter from '@sveltejs/adapter-auto';
1+
import adapter from '@sveltejs/adapter-static';
22
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
33

44
/** @type {import('@sveltejs/kit').Config} */
55
const config = {
66
// Consult https://kit.svelte.dev/docs/integrations#preprocessors
77
// for more information about preprocessors
8-
preprocess: [vitePreprocess({})],
8+
preprocess: vitePreprocess(),
99

1010
kit: {
11-
// adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
12-
// If your environment is not supported or you settled on a specific environment, switch out the adapter.
13-
// See https://kit.svelte.dev/docs/adapters for more information about adapters.
14-
adapter: adapter()
11+
adapter: adapter({
12+
fallback: 'index.html'
13+
}),
14+
alias: {
15+
$media: 'src/media/*'
16+
}
1517
}
1618
};
1719

nginx-default.conf

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
server {
2+
listen 80;
3+
server_name localhost;
4+
5+
#access_log /var/log/nginx/host.access.log main;
6+
7+
location / {
8+
root /usr/share/nginx/html;
9+
index index.html;
10+
try_files $uri /index.html;
11+
}
12+
13+
#error_page 404 /404.html;
14+
15+
# redirect server error pages to the static page /50x.html
16+
#
17+
error_page 500 502 503 504 /50x.html;
18+
location = /50x.html {
19+
root /usr/share/nginx/html;
20+
}
21+
22+
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
23+
#
24+
#location ~ \.php$ {
25+
# proxy_pass http://127.0.0.1;
26+
#}
27+
28+
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
29+
#
30+
#location ~ \.php$ {
31+
# root html;
32+
# fastcgi_pass 127.0.0.1:9000;
33+
# fastcgi_index index.php;
34+
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
35+
# include fastcgi_params;
36+
#}
37+
38+
# deny access to .htaccess files, if Apache's document root
39+
# concurs with nginx's one
40+
#
41+
#location ~ /\.ht {
42+
# deny all;
43+
#}
44+
}

0 commit comments

Comments
 (0)