Last active
December 23, 2020 02:31
-
-
Save chochinlu/3e6bd70968f9f425149ac18ace37d595 to your computer and use it in GitHub Desktop.
Create React App + Docker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.git | |
.gitignore | |
.idea | |
node_modules | |
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# build environment | |
FROM node:current-alpine3.12 AS build | |
WORKDIR /usr/src/app | |
COPY package.json yarn.lock ./ | |
# python 2 for node-gyp | |
RUN apk add --update --no-cache --virtual .gyp \ | |
python2 \ | |
make \ | |
g++ \ | |
&& yarn install \ | |
&& apk del .gyp | |
COPY . . | |
RUN yarn build | |
# production environment | |
FROM nginx:alpine | |
COPY nginx.conf /etc/nginx/conf.d/default.conf | |
COPY --from=build /usr/src/app/build /usr/share/nginx/html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment