Skip to content

Commit eae0c63

Browse files
react dockerized, nginx server added
1 parent 020b9ac commit eae0c63

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

react/Dockerfile

+14
Original file line numberDiff line numberDiff line change
@@ -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

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
server {
2+
3+
listen 3000;
4+
5+
location / {
6+
root /usr/share/nginx/html;
7+
index index.html index.htm;
8+
try_files $uri $uri/ /index.html;
9+
}
10+
}

0 commit comments

Comments
 (0)