Skip to content

Commit

Permalink
update elixir/phx version, add DB and add pg_dump and mysqldump
Browse files Browse the repository at this point in the history
  • Loading branch information
ysaito8015 committed Oct 3, 2020
1 parent 34e760c commit 53f88f4
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 6 deletions.
13 changes: 10 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM elixir:1.9.4
FROM elixir:1.10.4

ENV APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn
ENV DEBIAN_FRONTEND noninteractive
Expand All @@ -8,10 +8,17 @@ 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_12.x | sudo -E bash -

RUN apt-get -y install nodejs

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.5
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Docker を用いて Elixir/Phoenix アプリケーションの開発・学習を

* Debian 10 (Buster)
* Erlang/OTP 22.1.8
* Elixir 1.9.4
* Phoenix 1.4.11
* Elixir 1.10.4
* Phoenix 1.5.4
* Node.js 10.18
* npm 6.13

Expand Down
29 changes: 28 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
version: "3"
version: "3.1"
services:
postgres:
image: postgres:12.4-alpine
environment:
POSTGRES_USER: phoenix
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.21
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 +31,11 @@ services:
working_dir: /apps
ports:
- "4000:4000"
depends_on:
- postgres
- mysql
tty: true

volumes:
postgres_data:
mysql_data:

0 comments on commit 53f88f4

Please sign in to comment.