-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
30 lines (22 loc) · 880 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
FROM node:16-alpine
RUN apk add --no-cache openssl
ENV DOCKERIZE_VERSION v0.6.1
RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& tar -C /usr/local/bin -xzvf dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& rm dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz
WORKDIR /app
# Copying package.json and yarn.lock and installing node modules
# This helps caching the modules
COPY ./package*.json .
COPY ./yarn.lock .
RUN yarn install --frozen-lockfile
# RUN npm install --frozen-lockfile
COPY . .
RUN npx prisma generate
RUN yarn build
# RUN npm run build
EXPOSE 3000
ENV PORT 3000
# the container will wait until it gets connected to db
# once connected or timed out the scripts.sh is executed
CMD dockerize -wait tcp://db:3306 -timeout 100s sh scripts.sh