2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

docker-composeメモ(MySQL、FTPサーバ)

Posted at

完全に自分用のメモ書きです

mysql

ディレクトリ構造

project
 ├─ docker
 │    └ mysql
 │        ├─ conf 
 │        │    └─ my.cnf
 │        ├─ initdb.d
 │        │    ├─ 101_profile.sql
 │        │    ├─ 102_branch.sql
 │        │    └─ 103_price.sql
 │        └─ Dockerfile
 │
 └─ docker-compose.yml
docker-compose.yml
version: '3.3'
services:
  db:
    build: ./docker/mysql
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: password
      MYSQL_USER: user0101
      MYSQL_PASSWORD: password
      MYSQL_DATABASE: human
      TZ: Asia/Tokyo
    ports:
      - "3301:3301"
    volumes:
      - ./docker/mysql/initdb.d:/docker-entrypoint-initdb.d
      - ./docker/mysql/conf:/etc/mysql/conf.d
my.cnf
[mysqld]
character-set-server=utf8mb4
explicit_defaults_for_timestamp=1
general_log=1
general_log_file=/var/log/mysqld-query.log
wait_timeout = 60

[client]
default-character-set=utf8mb4

ftp

ディレクトリ構造

project
 ├─ docker
 │    └ ftp
 │        ├─ etc 
 │        └─ home
 │            └─ hoge.txt
 │
 └─ docker-compose.yml
docker-compose.yml
version: '3'
services:
  ftp-server:
    image: stilliard/pure-ftpd:latest
    container_name: ftp-server
    ports:
      - "21:21"
      - "30000-30009:30000-30009"
    volumes:
      - ./docker/ftp/home:/home/ftpusers
      - ./docker/ftp/etc:/etc/ssl/private
    environment:
      - PUBLICHOST=localhost
      - FTP_USER_NAME=ftpuser
      - FTP_USER_PASS=12345678
      - FTP_USER_HOME=/home/ftpusers
      - ADDED_FLAGS="--tls=2"
    restart: always
2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?