-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (22 loc) · 717 Bytes
/
Dockerfile
File metadata and controls
32 lines (22 loc) · 717 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
32
# Pull the base image
FROM node:16-alpine
# Set your working directory
WORKDIR /app
# Copy package.json, package-lock.json (if available) and yarn.lock (if available)
COPY package*.json yarn.lock ./
# Install git (only if it's necessary)
RUN apk add --no-cache git
# Set HUSKY to 0 to ignore husky during build
ENV HUSKY 0
# Remove the prepare script temporarily
RUN sed -i 's/"prepare":.*,//g' package.json
# Install dependencies
RUN yarn install --frozen-lockfile
# Add the prepare script back
RUN sed -i '/"scripts": {/a \ \ "prepare": "husky install && chmod ug+x .husky/*",' package.json
# Copy all other files
COPY . .
# Expose the listening port
EXPOSE 3000
# Run yarn dev script
CMD ["yarn", "dev"]