-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
48 lines (39 loc) · 1.34 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# DOCKERFILE FROM STANISLAV
# ---------------------------------------
# -> https://www.youtube.com/watch?v=NLjolI9FwCU
# FROM node:20.2-alpine AS sk-build
# WORKDIR /usr/src/app
# ARG TZ=Europe/Stockholm
# ARG PUBLIC_HELLO
# COPY . /usr/src/app
# RUN apk --no-cache add curl tzdata
# RUN cp /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# RUN npm install
# RUN npm run build
# FROM node:20.2-alpine
# WORKDIR /usr/src/app
# ARG TZ=Europe/Stockholm
# RUN apk --no-cache add curl tzdata
# RUN cp /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# COPY --from=sk-build /usr/src/app/package.json /usr/src/app/package.json
# COPY --from=sk-build /usr/src/app/package-lock.json /usr/src/app/package-lock.json
# RUN npm i --only=production
# COPY --from=sk-build /usr/src/app/build /usr/src/app/build
# EXPOSE 3000
# CMD ["node", "build/index.js"]
# # PUSH PRE-BUILT APP
# # ---------------------------------------
FROM node:20.10-alpine AS sk-build
WORKDIR /usr/src/app
# Copy app files to the container
COPY . /usr/src/app
COPY build ./build
COPY ./static ./static
# Install any required system packages (optional)
RUN apk --no-cache add curl tzdata
# Install dependencies
RUN npm install
# Expose the application port
EXPOSE 3000
# Start the application
CMD ["node", "build/index.js"]