Make website Docker ready
This commit is contained in:
15
frontend/Dockerfile
Normal file
15
frontend/Dockerfile
Normal file
@@ -0,0 +1,15 @@
|
||||
FROM node:alpine as builder
|
||||
WORKDIR '/app'
|
||||
COPY ./package.json ./
|
||||
RUN yarn
|
||||
COPY . .
|
||||
RUN yarn build
|
||||
|
||||
FROM nginx:alpine
|
||||
LABEL maintainer="Kevin Reis <contact@humenius.me>"
|
||||
|
||||
COPY --from=builder /app/build /usr/share/nginx/html
|
||||
COPY nginx/nginx.conf /etc/nginx/conf.d
|
||||
|
||||
EXPOSE 80
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
10
frontend/Dockerfile.dev
Normal file
10
frontend/Dockerfile.dev
Normal file
@@ -0,0 +1,10 @@
|
||||
FROM node:alpine
|
||||
|
||||
WORKDIR '/app'
|
||||
|
||||
COPY package.json .
|
||||
RUN yarn
|
||||
|
||||
COPY . .
|
||||
|
||||
CMD ["yarn", "start"]
|
||||
12
frontend/nginx/nginx.conf
Normal file
12
frontend/nginx/nginx.conf
Normal file
@@ -0,0 +1,12 @@
|
||||
server {
|
||||
listen 80;
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
index index.html index.htm;
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location = /50x.html {
|
||||
root /usr/share/nginx/html;
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "ts-onlinetime-ranks",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"proxy": "http://localhost:3500",
|
||||
"proxy": "http://tsotr.humenius.me/api",
|
||||
"dependencies": {
|
||||
"@testing-library/jest-dom": "^4.2.4",
|
||||
"@testing-library/react": "^9.3.2",
|
||||
|
||||
Reference in New Issue
Block a user