|
|
|
@@ -1,17 +1,16 @@ |
|
|
|
FROM node:16 |
|
|
|
|
|
|
|
WORKDIR ./src |
|
|
|
|
|
|
|
COPY package*.json ./ |
|
|
|
COPY src ./ |
|
|
|
COPY public ./ |
|
|
|
FROM node:16 AS builder |
|
|
|
|
|
|
|
WORKDIR /app |
|
|
|
# Copy all files from current directory to working dir in image |
|
|
|
COPY package*.json /app/ |
|
|
|
RUN npm install |
|
|
|
COPY ./ /app/ |
|
|
|
ENV REACT_APP_BASE_API_URL="https://trampa-api.dilig.net/" |
|
|
|
RUN npm run build |
|
|
|
|
|
|
|
ENV NODE_ENV='docker' |
|
|
|
|
|
|
|
# Bundle app source |
|
|
|
COPY . . |
|
|
|
|
|
|
|
EXPOSE 3000 |
|
|
|
CMD [ "npm", "start" ] |
|
|
|
FROM nginx:alpine |
|
|
|
WORKDIR /usr/share/nginx/html |
|
|
|
RUN rm -rf ./* |
|
|
|
COPY --from=builder /app/build . |
|
|
|
# Containers run nginx with global directives and daemon off |
|
|
|
ENTRYPOINT ["nginx", "-g", "daemon off;"] |