1
- #
2
- # Licensed to the Apache Software Foundation (ASF) under one
3
- # or more contributor license agreements. See the NOTICE file
4
- # distributed with this work for additional information
5
- # regarding copyright ownership. The ASF licenses this file
6
- # to you under the Apache License, Version 2.0 (the
7
- # "License"); you may not use this file except in compliance
8
- # with the License. You may obtain a copy of the License at
9
- #
10
- # http://www.apache.org/licenses/LICENSE-2.0
11
- #
12
- # Unless required by applicable law or agreed to in writing, software
13
- # distributed under the License is distributed on an "AS IS" BASIS,
14
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- # See the License for the specific language governing permissions and
16
- # limitations under the License.
17
- #
1
+ FROM node:14-alpine3.16
18
2
19
- FROM node:14-alpine3.13
3
+ RUN npm install pm2
20
4
21
- RUN mkdir -p /app
22
- WORKDIR /app/backend
5
+ WORKDIR /src
23
6
24
- ADD ./frontend /app/frontend
25
- ADD ./backend /app/backend
7
+ COPY . .
26
8
27
- RUN apk --no-cache add bash
9
+ RUN npm run setup
28
10
29
- RUN set -eux; \
30
- apk --no-cache --virtual .build-deps add git less openssh; \
31
- \
32
- cd /app/frontend; \
33
- yarn install; \
34
- yarn run build; \
35
- ls -A | grep -v 'build' | xargs rm -rf; \
36
- \
37
- cd /app/backend; \
38
- yarn install; \
39
- yarn run build; \
40
- ls -A | egrep -v "^(build|package|node_modules|sql)" | xargs rm -rf; \
41
- \
42
- cd /; \
43
- rm -rf $(yarn cache dir); \
44
- apk del .build-deps
11
+ CMD ["npm" , "run" , "start" ]
45
12
46
- COPY docker-entrypoint.sh /usr/local/bin/
47
- RUN chmod +x /usr/local/bin/docker-entrypoint.sh && ln -s /usr/local/bin/docker-entrypoint.sh /
48
- ENTRYPOINT ["docker-entrypoint.sh" ]
49
-
50
- EXPOSE 3001
13
+ EXPOSE 3000
0 commit comments