---
# System prepended metadata

title: Untitled

---

#wordpress編(docker-compose.yml)
----------------------------------------
version: "3.9"
services:
  db:
    image: mysql:5.7
    container_name: mysql
    volumes:
      - db_data:/var/lib/mysql
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: <任意のパスワード>
      MYSQL_DATABASE: <任意のデータベース名>
      MYSQL_USER: <任意のユーザー名>
      MYSQL_PASSWORD: <任意のパスワード>

  wordpress:
    depends_on:
      - db
    image: wordpress:latest
    container_name: wordpress
    volumes:
      - ./wp_data:/var/www/html
    ports:
      - "80:80"
    restart: always
    environment:
      WORDPRESS_DB_HOST: db:3306
      WORDPRESS_DB_NAME: <上のMYSQL_DATABASEで設定したデータベース名>
      WORDPRESS_DB_USER: <上のMYSQL_USEで設定したユーザー名>
      WORDPRESS_DB_PASSWORD: <上のMYSQL_PASSWORDで設定したパスワード>

volumes:
  db_data:
----------------------------------------
  
  
#Python編(docker-compose.yml)
----------------------------------------
version: '3.9'
services:
  python3:
    restart: always
    build: .
    container_name: 'python3'
    working_dir: '/root/'
    ports:
      - "4000:8888"
    tty: true
    volumes:
      - ./opt:/root/opt
----------------------------------------

#Python編(dockerfile)
----------------------------------------
FROM python:3
USER root

RUN apt-get update
RUN apt-get -y install locales && \
    localedef -f UTF-8 -i ja_JP ja_JP.UTF-8
ENV LANG ja_JP.UTF-8
ENV LANGUAGE ja_JP:ja
ENV LC_ALL ja_JP.UTF-8
ENV TZ JST-9
ENV TERM xterm

RUN apt-get install -y vim less
RUN pip install --upgrade pip
RUN pip install --upgrade setuptools
----------------------------------------



version: "3.9"

services:
  db:
    image: mysql:5.7
    container_name: mysql
    volumes:
      - db_data:/var/lib/mysql
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: sun4go
      MYSQL_DATABASE: practice
      MYSQL_USER: maru
      MYSQL_PASSWORD: sun4go

  wordpress:
    depends_on:
      - db
    image: wordpress:latest
    container_name: wordpress
    volumes:
      - ./wp_data:/var/www/html
    ports:
      - "80:80"
    restart: always
    environment:
      WORDPRESS_DB_HOST: db:3306
      WORDPRESS_DB_NAME: practice
      WORDPRESS_DB_USER: maru
      WORDPRESS_DB_PASSWORD: sun4go

volumes:
  db_data: