forked from makeopensource/devU
-
Notifications
You must be signed in to change notification settings - Fork 0
/
api.Dockerfile
46 lines (26 loc) · 904 Bytes
/
api.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
FROM node:20 AS module_builder
WORKDIR /tmp
COPY devU-shared .
RUN npm install && \
npm run clean-directory && \
npm run build-docker
FROM docker.io/python:alpine AS config-builder
WORKDIR /config
RUN apk add --no-cache bash jq openssl \
&& pip install yq
COPY devU-api/scripts/ .
COPY devU-api/config/ ./config
RUN ./generateConfig.sh default.yml
FROM node:20
WORKDIR /app
COPY ./devU-api/package.json ./
RUN npm install
COPY ./devU-api .
COPY --from=config-builder /config/default.yml ./config/default.yml
COPY --from=module_builder /tmp/devu-shared-modules ./devu-shared-modules
# Indicate that the api is running in docker; value here is irrelevant
ENV IS_DOCKER=0
ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.2.1/wait /wait
RUN chmod +x /wait
# TypeORM Migrations
CMD /wait && npm run typeorm -- migration:run -d src/database.ts && npm start