forked from REAN-Foundation/forms-service
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
90 lines (67 loc) · 1.66 KB
/
Dockerfile
File metadata and controls
90 lines (67 loc) · 1.66 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
FROM node:18.20.8-alpine3.21 AS builder
COPY . /app
RUN apk add bash
RUN apk add --no-cache \
python3 \
py3-pip \
# && pip3 install --upgrade pip \
# && pip3 install \
# awscli \
&& rm -rf /var/cache/apk/*
RUN apk add --update alpine-sdk
WORKDIR /app
COPY package*.json /app/
RUN npm install -g typescript
RUN npm install
COPY src ./src
COPY tsconfig.json ./
RUN npx prisma generate
RUN npm run build
##
FROM node:18.20.8-alpine3.21
RUN apk add bash
RUN apk add --no-cache \
python3 \
py3-pip \
# && pip3 install --upgrade pip \
&& pip3 install --break-system-packages awscli \
&& rm -rf /var/cache/apk/*
RUN apk add --update alpine-sdk
RUN apk update
RUN apk upgrade
COPY . /app
WORKDIR /app
COPY package*.json /app/
RUN npm install pm2 -g
RUN npm install
COPY --from=builder /app/dist /app/dist
RUN chmod +x /app/entrypoint.sh
EXPOSE 5555
CMD ["sh", "-c", "npx prisma migrate deploy"]
ENTRYPOINT ["/bin/sh", "./entrypoint.sh"]
# FROM node:18.20-alpine3.19
# EXPOSE 5555
# RUN apk update
# RUN apk upgrade
# RUN apk add bash
# RUN apk add --no-cache \
# python3 \
# py3-pip \
# curl \
# unzip
# # Download and install AWS CLI
# RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" \
# && unzip awscliv2.zip \
# && ./aws/install \
# && rm -rf awscliv2.zip aws
# WORKDIR /app
# COPY package*.json ./
# RUN npm install -g typescript
# RUN npm install
# COPY . .
# RUN npx prisma generate
# RUN npm run build
# RUN npm install pm2 -g
# CMD ["sh", "-c", "npx prisma migrate deploy"]
# RUN chmod +x ./entrypoint.sh
# ENTRYPOINT ["/bin/sh", "./entrypoint.sh"]