docker 最简单的file-server

date
May 31, 2022
slug
newservice-static-file-server
status
Published
summary
新服务 Docker
tags
service
type
Post
URL

Summary

notion image
notion image

步骤

export DOCKER_PROJ=static-file-server
export DOCKER_PORT=18360
mkdir /data/$DOCKER_PROJ; cd /data/$DOCKER_PROJ
cat > docker-compose.yml <<EOF
version: '3.3'
services:
    $DOCKER_PROJ:
        container_name: $DOCKER_PROJ
        image: 'halverneus/static-file-server:latest'
        restart: always
        volumes:
            - './web:/web'
        ports:
            - '$DOCKER_PORT:8080'
        environment:
          - SHOW_LISTING=false
networks:
  default:
    name: npm_nginx_proxy_manager-network
    external: true
EOF

docker-compose down; docker-compose up -d; sleep 1s; docker-compose logs -f
 

验证


© Ying Bun 2021 - 2024