-
Notifications
You must be signed in to change notification settings - Fork 77
/
Dockerfile
79 lines (64 loc) · 1.47 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
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
#FROM node:18.16.1-alpine
#
#COPY setup.sh
#
#RUN apk add --no-cache bash
#RUN npm i -g @nestjs/cli typescript ts-node
#
#COPY package*.json /tmp/app/
#RUN cd /tmp/app && npm install
#
#COPY . /usr/src/app
#RUN cp -a /tmp/app/node_modules /usr/src/app
#COPY ./wait-for-it.sh /opt/wait-for-it.sh
#COPY ./startup.dev.sh /opt/startup.dev.sh
#RUN sed -i 's/
#//g' /opt/wait-for-it.sh
#RUN sed -i 's/
#//g' /opt/startup.dev.sh
#
#WORKDIR /usr/src/app
#RUN cp env-example .env
#RUN npx prisma generate
#RUN npm run build
#
#CMD ["/opt/startup.dev.sh"]
#
#EXPOSE 3000
#FROM node:18.16.1-alpine
#
#WORKDIR /usr/src/app
#
#COPY . .
#
#RUN apt-get update && apt-get install -y curl && apt-get install -y git
#CMD /bin/bash
#COPY ./package*.json ./
#RUN ./setup.sh
#
#ENV NODE_ENV production
#CMD ["npm", "i"]
#CMD [ "npm", "run", "start:dev" ]
#
#EXPOSE 3000
FROM node:20.11.0-alpine
# Set the working directory
WORKDIR /usr/src/app
# Install curl and git using apk
RUN apk update && apk add --no-cache curl git
RUN #npm config set registry http://registry.npmjs.org/
# Copy package files first for better caching of npm install
COPY ./package*.json ./
# Install dependencies
RUN npm install
# Copy the rest of the application code
COPY . .
# Convert setup.sh to Unix-style line endings (LF)
RUN sed -i 's/\r$//' ./setup.sh
# Run any additional setup script
RUN chmod +x ./setup.sh
RUN ./setup.sh
# Set environment variable
ENV NODE_ENV production
# Start the application
CMD ["npm", "run", "start:dev"]