-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathDockerfile
33 lines (23 loc) · 896 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
FROM node:20.12.2-alpine
# Yarn will not install any package listed in devDependencies if the NODE_ENV
# environment variable is set to production. Use this flag to instruct Yarn to
# ignore NODE_ENV and take its production-or-not status from this flag instead.
ARG NODE_ENV=production
# Note layers should be ordered from less to more likely to change.
# Update & install required packages
RUN apk add --update bash curl;
# Needed for Gcloud Storage resumable file uploads
RUN mkdir -p /root/.config
# Set work directory
WORKDIR /service
# Install dependencies and store yarn cache
COPY package.json yarn.lock ./
RUN --mount=type=cache,target=/root/.yarn YARN_CACHE_FOLDER=/root/.yarn yarn install --frozen-lockfile
# Copy app source
COPY . .
# Set your port
ENV PORT=2300
# Expose the port to outside world
EXPOSE 2300
# Start production server
CMD ["yarn", "-s", "start:production"]