Skip to content

Commit 1034949

Browse files
authored
Update: Using Debian image (18.20-slim) (#579)
* Update: using Slim 18.20 node image * updates * added openssl for debian
1 parent 18cf2ff commit 1034949

File tree

1 file changed

+17
-20
lines changed

1 file changed

+17
-20
lines changed

Dockerfile

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
FROM node:18.19-alpine AS base
2-
3-
# Install tini & build dependencies
4-
RUN apk add --no-cache tini && \
5-
apk --no-cache --virtual build-dependencies add g++ make py3-pip openssl
1+
FROM node:18.20-slim AS base
62

73
# Upgrade packages
8-
RUN apk update && apk upgrade
4+
RUN apt-get -y update && apt-get -y upgrade
5+
6+
# Install tini & build dependencies
7+
RUN apt-get install -y g++ make python3-pip openssl
98

109
# Set the working directory
1110
WORKDIR /app
@@ -30,7 +29,7 @@ RUN openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 \
3029
WORKDIR /app
3130

3231
# Clean up build dependencies
33-
RUN apk del build-dependencies
32+
# RUN apt del build-dependencies
3433

3534
##############################
3635
##############################
@@ -41,9 +40,6 @@ EXPOSE 3005
4140
ENV NODE_ENV="local"
4241
RUN npm install -g nodemon
4342

44-
# Use tini as entrypoint to handle killing processes
45-
ENTRYPOINT ["/sbin/tini", "--"]
46-
4743
CMD [ "sh", "-c","yarn prisma:setup:dev && yarn dev:run" ]
4844

4945
##############################
@@ -54,29 +50,32 @@ FROM base AS prod-dependencies
5450

5551
WORKDIR /app
5652

53+
# Upgrade packages
54+
RUN apt-get -y update && apt-get -y upgrade
55+
5756
# Build the project
58-
RUN apk --no-cache --virtual build-dependencies add g++ make py3-pip && \
57+
RUN apt-get install -y g++ make python3-pip && \
5958
yarn build && \
6059
yarn copy-files && \
6160
rm -rf node_modules && \
62-
yarn install --production=true --frozen-lockfile --network-timeout 1000000 && \
63-
apk del build-dependencies
61+
yarn install --production=true --frozen-lockfile --network-timeout 1000000
6462

65-
# Upgrade packages
66-
RUN apk update && apk upgrade
6763

6864
##############################
6965
##############################
7066

7167
# Production stage
72-
FROM node:18.19-alpine AS prod
68+
FROM node:18.20-slim AS prod
7369

7470
# Setting ENV variables for image information
7571
ARG ENGINE_VERSION
7672
ENV ENGINE_VERSION=${ENGINE_VERSION}
7773

78-
# Install tini
79-
RUN apk add --no-cache tini
74+
# Upgrade packages
75+
RUN apt-get -y update && apt-get -y upgrade
76+
77+
# Install openssl
78+
RUN apt-get install -y openssl
8079

8180
# Set the working directory
8281
WORKDIR /app
@@ -96,6 +95,4 @@ COPY --from=prod-dependencies /app/node_modules ./node_modules
9695
COPY --from=prod-dependencies /app/dist ./dist
9796
COPY --from=base /app/src/https ./dist/https
9897

99-
# Use tini as entrypoint to handle killing processes
100-
ENTRYPOINT ["/sbin/tini", "--"]
10198
CMD [ "yarn", "start"]

0 commit comments

Comments
 (0)