# Dockerfile

# Maven + Spring Boot

FROM maven:3-openjdk-16
WORKDIR /code
RUN mkdir -p /root/.m2 && curl -sL https://blog.lyh543.cn/mirrors/maven.xml -o /root/.m2/settings.xml
COPY pom.xml .
RUN mvn clean package -Dmaven.test.skip -Dmaven.main.skip -Dspring-boot.repackage.skip && rm -r target/
COPY src ./src
RUN mvn clean package -Dmaven.test.skip
EXPOSE 9091
CMD ["java", "-jar", "target/Aurora-DriveSyncer-0.0.1-SNAPSHOT.jar"]

# npm

FROM node:14.1-alpine AS builder
WORKDIR /code
RUN npm config set registry https://registry.npm.taobao.org
COPY package.json package-lock.json ./
RUN npm install
COPY . ./
EXPOSE 3000
CMD ["npm", "run", "start"]

# docker-compose

# 调用本地 / git 上的 dockerfile

version: "3.9"
services:
  frontend:
    build: https://github.com/Aurora-DriveSyncer/Aurora-DriveSyncer-frontend.git
    ports:
      - "3000:3000"
  backend:
    build: ../Aurora-DriveSyncer-backend
    ports:
      - "9091:9091"

# ftp

ftp:
  image: fauria/vsftpd
  environment:
    FTP_USER: "user"
    FTP_PASS: "user"
    # LOG_STDOUT: "1"
    PASV_MIN_PORT: "21000"
    PASV_MAX_PORT: "21010"
    PASV_ADDRESS: "127.0.0.1"
    REVERSE_LOOKUP_ENABLE: "NO"
  ports:
    - "20-21:20-21"
    - "21000-21010:21000-21010"
  restart: always

# webdav

webdav:
  image: bytemark/webdav
  restart: always
  ports:
    - "80:80"
  environment:
    AUTH_TYPE: Digest
    USERNAME: alice
    PASSWORD: secret1234
  volumes:
    - /srv/dav:/var/lib/dav