Skip to content

Commit

Permalink
update elixir/phx version, add DB and add pg_dump and mysqldump, amen…
Browse files Browse the repository at this point in the history
…d gitignore, update README.md
  • Loading branch information
ysaito8015 committed Feb 19, 2021
1 parent 34e760c commit 8707f8a
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 14 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/apps/
!/apps/.gitkeep
15 changes: 11 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM elixir:1.9.4
FROM elixir:1.11.3

ENV APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn
ENV DEBIAN_FRONTEND noninteractive
Expand All @@ -8,9 +8,16 @@ RUN apt-get update
RUN apt-get -y upgrade
RUN apt-get -y install git vim sudo inotify-tools

RUN curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -

RUN curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
RUN apt-get -y install nodejs
RUN npm install -g npm

RUN sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
RUN sudo wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
RUN apt-get update
RUN apt-get -y install postgresql-client-12 default-mysql-client

RUN apt-get update && apt-get -y upgrade

ARG UID=1000
ARG GID=1000
Expand All @@ -27,4 +34,4 @@ WORKDIR /apps

RUN mix local.hex --force
RUN mix local.rebar --force
RUN mix archive.install --force hex phx_new 1.4.11
RUN mix archive.install --force hex phx_new 1.5.7
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,21 @@ Docker を用いて Elixir/Phoenix アプリケーションの開発・学習を
## 構築される環境

* Debian 10 (Buster)
* Erlang/OTP 22.1.8
* Elixir 1.9.4
* Phoenix 1.4.11
* Node.js 10.18
* npm 6.13
* Erlang/OTP 23
* Elixir 1.11.3
* Phoenix 1.5.7
* Node.js 14.15.4
* npm 7.5.4

## 必要なソフトウェア

* Docker 18 以上
* Docker 20 以上
* Docker Compose 1.27 以上
* Git 2.7 以上

## 動作確認済みのOS

* macOS 10.14 Mojave
* Ubuntu 16.04
* Ubuntu 18.04
* macOS Big Sur v11
* macOS Catalina v10.15
* Ubuntu 20.04

30 changes: 29 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
version: "3"
version: "3.1"
services:
postgres:
image: postgres:12.5-alpine
environment:
POSTGRES_USER: phoenix
POSTGRES_DB: nano_planner_dev
POSTGRES_PASSWORD: phoenix
POSTGRES_INITDB_ARGS: "--encoding=UTF-8 --locale=ja_JP.UTF-8"
volumes:
- postgres_data:/var/lib/postgresql/data

mysql:
image: mysql:8.0.22
command: --default-authentication-plugin=mysql_native_password
environment:
MYSQL_ROOT_PASSWORD: example
MYSQL_USER: phoenix
MYSQL_PASSWORD: phoenix
MYSQL_DATABASE: nano_planner_dev
volumes:
- mysql_data:/var/lib/mysql

web:
build: .
command: bash
Expand All @@ -11,4 +32,11 @@ services:
working_dir: /apps
ports:
- "4000:4000"
depends_on:
- postgres
- mysql
tty: true

volumes:
postgres_data:
mysql_data:

0 comments on commit 8707f8a

Please sign in to comment.