Commit bedf287d authored by Javier Arias's avatar Javier Arias Committed by 陈帅

Add Docker support (#2430)

* add dockerfile

* add development dockerfile

* add development docker-compose file

* add docker-compose file

* add nginx config

* move dockerfiles to their own directory

* move nginx config to docker
parent 28d6240c
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"]
FROM node:latest
WORKDIR /usr/src/app/
COPY package.json ./
RUN npm install --silent --no-cache
COPY ./ ./
CMD ["npm", "run", "start"]
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
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:
server {
listen 80;
root /usr/share/nginx/html;
location / {
try_files $uri $uri/ /index.html;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment