We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 020b9ac commit eae0c63Copy full SHA for eae0c63
react/Dockerfile
@@ -0,0 +1,14 @@
1
+FROM node:alpine as build
2
+WORKDIR /app
3
+ENV PATH /app/node_modules/.bin:$PATH
4
+COPY package.json /app/package.json
5
+RUN npm install --silent
6
+COPY . /app
7
+RUN npm run build
8
+
9
+FROM nginx:alpine
10
+COPY --from=build /app/build /usr/share/nginx/html
11
+RUN rm /etc/nginx/conf.d/default.conf
12
+COPY ./nginx/nginx.conf /etc/nginx/conf.d
13
+EXPOSE 3000
14
+CMD ["nginx", "-g", "daemon off;"]
react/nginx/nginx.conf
@@ -0,0 +1,10 @@
+server {
+ listen 3000;
+ location / {
+ root /usr/share/nginx/html;
+ index index.html index.htm;
+ try_files $uri $uri/ /index.html;
+ }
+}
0 commit comments