File size: 841 Bytes
e34472c
 
 
 
 
51aa2e1
 
e34472c
488d2e9
 
e34472c
8f8a205
 
e34472c
 
 
 
 
 
 
74a884c
 
 
 
 
 
 
 
 
e34472c
 
74a884c
e34472c
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
FROM oven/bun:1 as build

# Set working directory
WORKDIR /app

# Copy the viewer directory with all its contents
COPY viewer/ .

# Install dependencies without frozen lockfile to allow migration from package-lock.json
RUN bun install

# Build the application with more verbose output
RUN bun run build || (echo "Build failed. Check the error messages above." && exit 1)

# Production stage
FROM nginx:alpine

# Copy built assets from build stage
COPY --from=build /app/dist /usr/share/nginx/html

# Configure nginx to use port 7860 and support SPA routing
RUN echo 'server { \
    listen 7860; \
    root /usr/share/nginx/html; \
    index index.html; \
    location / { \
    try_files $uri $uri/ /index.html; \
    } \
    }' > /etc/nginx/conf.d/default.conf

# Expose port
EXPOSE 7860

# Start nginx
CMD ["nginx", "-g", "daemon off;"]