-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.render
51 lines (40 loc) · 1.17 KB
/
Dockerfile.render
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
FROM node:16 AS frontend-build
WORKDIR /usr/src/app
COPY ./frontend/ /usr/src/app
RUN npm install && npm run build
FROM node:16 AS app-build
WORKDIR /usr/src/app
COPY ./backend/src /usr/src/app/src
COPY ./backend/package.json /usr/src/app
RUN npm install
COPY ./backend/start.sh /usr/src/app
COPY ./backend/nodemon.json /usr/src/app
COPY ./backend/tsconfig.json /usr/src/app
COPY ./backend/tsoa.json /usr/src/app/tsoa.json
RUN npm run swagger-generate
RUN npm run generate
RUN npm run build
COPY --from=frontend-build /usr/src/app/build/ /usr/src/app/dist/src/web/
# Configure environment variables
# ARG RENDER_EXTERNAL_URL \
# RENDER_GIT_COMMIT \
# RENDER_GIT_BRANCH \
# RENDER_GIT_REPO_SLUG \
# DATABASE_URL \
# TOKEN_SECRET
ARG DATABASE_URL
ARG TOKEN_SECRET
# ARG STATIC_URL
RUN echo $DATABASE_URL
RUN echo $TOKEN_SECRET
# ENV STATIC_URL=$RENDER_EXTERNAL_URL
# ENV GIT_REPO_NAME=$RENDER_GIT_REPO_SLUG
# ENV GIT_COMMIT_SHA=$RENDER_GIT_COMMIT
ENV NODE_ENV=PROD
ENV PORT=10000
ENV STATIC_URL=$RENDER_EXTERNAL_URL
ENV GIT_BRANCH="main"
ENV DATABASE_URL=$DATABASE_URL
ENV TOKEN_SECRET=$TOKEN_SECRET
EXPOSE 10000
CMD [ "node", "/usr/src/app/dist/src/index.js" ]