-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
39 lines (33 loc) · 855 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
31
32
33
34
35
36
37
38
39
# build environment
FROM node:18.18-alpine3.18 as build
WORKDIR .
ENV PATH node_modules/.bin:$PATH
COPY client/package.json ./
COPY client/package-lock.json ./
COPY client/public ./
RUN npm i -g --silent [email protected]
RUN npm i --silent
RUN npm install [email protected] -g --silent
COPY client/ ./
ENV REACT_APP_ENVIRONMENT=production
RUN npm run build
# production environment
FROM node:18.18-alpine3.18
RUN apk add --update nginx bash
RUN mkdir /var/cache/nginx
COPY --from=build /build /app/build
COPY nginx/nginx.conf /etc/nginx/nginx.conf
COPY entrypoint.sh /
# Create app directory
WORKDIR /app
# Install app dependencies
COPY server/package*.json ./
RUN npm ci --omit=dev
RUN npm install -g sequelize-cli
# Move source
COPY server/src ./src
COPY server/.sequelizerc .
EXPOSE 80
ENV NODE_ENV=production
WORKDIR /
CMD ["bash", "/entrypoint.sh"]