-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
30 lines (29 loc) · 984 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:14 AS build
ARG COGNITO_REGION
ARG COGNITO_USER_POOL_ID
ARG COGNITO_APP_CLIENT_ID
ARG SOCKETIO_HOST
ARG AWS_ACCESS_KEY_ID
ARG AWS_SECRET_KEY_ID
WORKDIR '/app'
COPY . /app
RUN ls
RUN cd client && yarn
RUN cd server && npm i
RUN cd client touch .env
RUN cd client echo "REACT_APP_COGNITO_REGION=$COGNITO_REGION" >> .env
RUN cd client echo "REACT_APP_COGNITO_USER_POOL_ID=$COGNITO_USER_POOL_ID" >> .env
RUN cd client echo "REACT_APP_COGNITO_APP_CLIENT_ID=$COGNITO_APP_CLIENT_ID" >> .env
RUN cd client echo "REACT_APP_SOCKETIO_HOST=$SOCKETIO_HOST" >> .env
RUN cd client echo "REACT_APP_AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID" >> .env
RUN cd client echo "REACT_APP_AWS_SECRET_KEY_ID=$AWS_SECRET_KEY_ID" >> .env
RUN echo $COGNITO_REGION
RUN cd server && npm run build
FROM node:14 AS image
WORKDIR '/app'
COPY --from=build ./app/server/dist ./dist/
COPY --from=build ./app/server/package.json ./dist/package.json
RUN ls
RUN cd dist && npm i
EXPOSE 5000
CMD cd dist && node Index.js