diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..54e1a4a71baa4fb396896171f9fe4962c3ac2c16 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,13 @@ +FROM node:latest + +WORKDIR /usr/src/app/ + +COPY package.json ./ +RUN npm install --silent --no-cache + +COPY ./ ./ + +RUN sh ./tests/fix_puppeteer.sh +RUN npm run test:all + +CMD ["npm", "run", "build"] diff --git a/docker/Dockerfile.dev b/docker/Dockerfile.dev new file mode 100644 index 0000000000000000000000000000000000000000..fdbb0e00e02a97af4c24428d3619afe6d802681b --- /dev/null +++ b/docker/Dockerfile.dev @@ -0,0 +1,10 @@ +FROM node:latest + +WORKDIR /usr/src/app/ + +COPY package.json ./ +RUN npm install --silent --no-cache + +COPY ./ ./ + +CMD ["npm", "run", "start"] diff --git a/docker/docker-compose.dev.yml b/docker/docker-compose.dev.yml new file mode 100644 index 0000000000000000000000000000000000000000..d206d872f7ecfab39b03898094ab6759e4b30895 --- /dev/null +++ b/docker/docker-compose.dev.yml @@ -0,0 +1,12 @@ +version: "3.5" + +services: + ant-design-pro_dev: + build: + context: ./ + dockerfile: Dockerfile.dev + container_name: "ant-design-pro_dev" + volumes: + - ./src:/usr/src/app/src + - ./config:/usr/src/app/config + - ./mock:/usr/src/app/mock diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..fa849a0431e2f37fe51abd976c813348f8e3a69a --- /dev/null +++ b/docker/docker-compose.yml @@ -0,0 +1,19 @@ +version: "3.5" + +services: + ant-design-pro_build: + build: ./ + container_name: "ant-design-pro_build" + volumes: + - dist:/usr/src/app/dist + + ant-design-pro_web: + image: nginx + container_name: "ant-design-pro_web" + restart: unless-stopped + volumes: + - dist:/usr/share/nginx/html:ro + - ./nginx.conf:/etc/nginx/conf.d/default.conf + +volumes: + dist: diff --git a/docker/nginx.conf b/docker/nginx.conf new file mode 100644 index 0000000000000000000000000000000000000000..38c7f17baabb4452e67115f6c98b764df0ec1245 --- /dev/null +++ b/docker/nginx.conf @@ -0,0 +1,9 @@ +server { + listen 80; + + root /usr/share/nginx/html; + + location / { + try_files $uri $uri/ /index.html; + } +}