-
Notifications
You must be signed in to change notification settings - Fork 27
/
Dockerfile
33 lines (26 loc) · 1.03 KB
/
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
# Define the image to use. Bookworm runs Node 20 inside a Debian container.
# View node:20-bookworm image here: https://hub.docker.com/_/node
FROM node:20-bookworm AS setup
LABEL maintainer="Isaac Hunter"
# Copy essential node & npm files to the container for initialization
COPY ./package.json /app/package.json
COPY ./package-lock.json /app/package-lock.json
COPY ./index.html /app/index.html
COPY ./vite.config.ts /app/vite.config.ts
COPY ./tsconfig.json /app/tsconfig.json
COPY ./tsconfig.node.json /app/tsconfig.node.json
# Set the working directory to /app/client
WORKDIR /app
# Install the dependencies inside container
RUN npm install && \
npm install -g rimraf
# Copy the rest of the files to the container
COPY ./public /app/public
COPY ./src /app/src
# Build the app
RUN npm run build
# Creates a volume for the dist folder so that the server can access it
VOLUME /app/dist
# EXPOSE and CMD are not needed for the client container
# because it is not a server. It is only used to build the
# static files for the server to serve.