Skip to content

Commit aabf889

Browse files
committed
Try the node
1 parent 7bc41c5 commit aabf889

File tree

4 files changed

+242
-36
lines changed

4 files changed

+242
-36
lines changed

src/client/Dockerfile

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,23 @@
1-
# Stage 1: Build the application
2-
FROM node:22-alpine AS builder
1+
# Use an official Node.js runtime as the base image
2+
FROM node:22-alpine
33

4-
# Set working directory
4+
# Set the working directory
55
WORKDIR /app
66

7-
# Copy package files and install dependencies
7+
# Copy package.json and package-lock.json (if available)
88
COPY package*.json ./
9-
RUN npm ci
109

11-
# Copy the rest of your application code
12-
COPY . .
10+
# Install dependencies
11+
RUN npm install
1312

14-
# Accept build argument and set environment variable
15-
ARG VITE_BASE_URL
16-
ENV VITE_BASE_URL=$VITE_BASE_URL
13+
# Copy the rest of your application's code
14+
COPY . .
1715

18-
# Build the application
16+
# Build the SvelteKit app
1917
RUN npm run build
2018

21-
# Stage 2: Serve the application using Nginx
22-
FROM nginx:alpine
23-
24-
# Copy the build output to Nginx's html directory
25-
COPY --from=builder /app/build /usr/share/nginx/html
26-
27-
# Expose port 80
28-
EXPOSE 80
19+
# Expose the port your app runs on
20+
EXPOSE 3000
2921

30-
# Start Nginx when the container launches
31-
CMD ["nginx", "-g", "daemon off;"]
22+
# Command to run your app
23+
CMD ["node", "build"]

src/client/package-lock.json

Lines changed: 225 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/client/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
"devDependencies": {
1616
"@eslint/compat": "^1.2.3",
1717
"@sveltejs/adapter-auto": "^3.0.0",
18+
"@sveltejs/adapter-node": "^5.2.11",
19+
"@sveltejs/adapter-static": "^3.0.8",
1820
"@sveltejs/kit": "^2.0.0",
1921
"@sveltejs/vite-plugin-svelte": "^4.0.0",
2022
"eslint": "^9.7.0",

0 commit comments

Comments
 (0)