Skip to content

Commit b3f8502

Browse files
add dockerfile and fix build
1 parent 11fd5f1 commit b3f8502

File tree

6 files changed

+62
-3
lines changed

6 files changed

+62
-3
lines changed

Dockerfile

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Use an official Node.js runtime as the base image
2+
FROM node:18 as build-stage
3+
LABEL authors="xcodeassociated"
4+
5+
# Set working directory
6+
WORKDIR /app
7+
8+
# Copy package.json and package-lock.json to the working directory
9+
COPY package*.json ./
10+
11+
# Install dependencies
12+
RUN npm install
13+
14+
# Copy app source code to the working directory
15+
COPY . .
16+
17+
## Generate types
18+
#RUN npm run generate:graphql
19+
20+
RUN node node_modules/esbuild/install.js
21+
22+
# Build the app
23+
RUN npm run build
24+
25+
# Use NGINX as the production server
26+
FROM nginx:stable-alpine-slim
27+
28+
# Copy the NGINX configuration file
29+
COPY nginx.conf /etc/nginx/conf.d/default.conf
30+
31+
# Copy the build output from the build stage to NGINX
32+
COPY --from=build-stage /app/dist /usr/share/nginx/html
33+
34+
# Expose port 80
35+
EXPOSE 80
36+
37+
# Start NGINX
38+
CMD ["nginx", "-g", "daemon off;"]

nginx.conf

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
server {
2+
listen 80;
3+
server_name localhost;
4+
5+
location / {
6+
root /usr/share/nginx/html;
7+
index index.html;
8+
try_files $uri $uri/ /index.html;
9+
}
10+
11+
error_page 500 502 503 504 /50x.html;
12+
location = /50x.html {
13+
root /usr/share/nginx/html;
14+
}
15+
16+
location /health {
17+
return 200;
18+
}
19+
}

tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
"path": "./tsconfig.node.json"
99
}
1010
],
11-
"include": ["./vitest.setup.ts"],
1211
"compilerOptions": {
1312
"baseUrl": ".",
1413
"paths": {

tsconfig.tsbuildinfo

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

vite.config.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ export default defineConfig({
1212
globals: true,
1313
environment: 'jsdom',
1414
css: true,
15-
setupFiles: ['./vitest.setup.ts'],
15+
},
16+
server: {
17+
host: '0.0.0.0',
18+
port: 3000,
1619
},
1720
resolve: {
1821
alias: {

vitest.setup.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)