forked from freeCodeCamp/Developer_Quiz_Site
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (22 loc) · 689 Bytes
/
Dockerfile
File metadata and controls
31 lines (22 loc) · 689 Bytes
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
ARG BASE_REGISTRY=docker.io
ARG BASE_IMAGE=node
ARG BASE_TAG=22-alpine
FROM ${BASE_REGISTRY}/${BASE_IMAGE}:${BASE_TAG}
# Install git for pnpm -> yarn interop dependencies
RUN apk add --no-cache git
# Install pnpm package manager globally
RUN npm install -g pnpm@9
# Create app directory
WORKDIR /usr/src/app
# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
COPY package*.json ./
RUN pnpm install
# Install xdg-utils for `open:true` vite config - spawn xdg-open ENOENT err
RUN apk add --update xdg-utils
# Bundle app source
COPY . .
# Container listening on port 3000
EXPOSE 3000
# Start the app
CMD [ "pnpm", "start" ]