forked from ProjectMirador/mirador-integration
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
36 lines (25 loc) · 861 Bytes
/
Dockerfile
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
# Stage 1: Build the app using Parcel
FROM node:20-alpine AS build
# Set the working directory inside the container
WORKDIR /app
# Copy package.json and package-lock.json to install dependencies
COPY package*.json ./
# Install the dependencies (you can use npm ci for faster, reproducible installs)
RUN npm install
# Copy the rest of the app's source code
COPY . .
# Build the app
RUN npm run webpack
# Stage 2: Serve the bundled app
FROM node:20-alpine AS production
# Install a simple HTTP server to serve the static files
RUN npm install -g http-server
# Set the working directory for serving the built files
WORKDIR /app
# Copy the build output from the build stage
COPY --from=build /app/dist /app/dist
COPY webpack/index.html /app
# Expose the port that the server will use
EXPOSE 8080
# Start the HTTP server
CMD ["http-server", "-p", "8080"]