mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-12-25 03:50:53 +00:00
Add dev dockerfiles
This commit is contained in:
parent
eb67122771
commit
4402677704
2 changed files with 62 additions and 0 deletions
25
Dockerfile.dev
Normal file
25
Dockerfile.dev
Normal file
|
@ -0,0 +1,25 @@
|
|||
FROM ruby:2.2.10
|
||||
|
||||
ENV RAILS_ENV development
|
||||
|
||||
# Add 'web' user which will run the application
|
||||
RUN adduser web --home /home/web --shell /bin/bash --disabled-password --gecos ""
|
||||
|
||||
RUN apt-get update && apt-get -y upgrade \
|
||||
&& apt-get -y install mysql-client libmysqlclient-dev memcached nodejs firefox-esr \
|
||||
&& service memcached start
|
||||
|
||||
# Separate Gemfile ADD so that `bundle install` can be cached more effectively
|
||||
|
||||
ADD Gemfile Gemfile.lock /var/www/
|
||||
|
||||
RUN mkdir -p /var/bundle && chown -R web:web /var/bundle && chown -R web:web /var/www
|
||||
RUN su -c "bundle config github.https true; cd /var/www && bundle install --path /var/bundle --jobs 4" -s /bin/bash -l web
|
||||
|
||||
WORKDIR /var/www
|
||||
USER web
|
||||
|
||||
RUN bundle config github.https true; cd /var/www && bundle install --path /var/bundle --jobs 4
|
||||
|
||||
USER root
|
||||
CMD ["/var/www/script/entry.sh"]
|
37
docker-compose.dev.yml
Normal file
37
docker-compose.dev.yml
Normal file
|
@ -0,0 +1,37 @@
|
|||
version: "3"
|
||||
|
||||
services:
|
||||
web:
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: Dockerfile.dev
|
||||
args:
|
||||
buildno: 1
|
||||
volumes:
|
||||
- ".:/var/www/"
|
||||
ports:
|
||||
- "4000:4000"
|
||||
links:
|
||||
- db
|
||||
- memcached
|
||||
# - redis
|
||||
db:
|
||||
# Debug
|
||||
# command: bash
|
||||
#tty: true
|
||||
command: mysqld_safe --skip-grant-tables
|
||||
image: mariadb:latest
|
||||
volumes:
|
||||
- "./db_data:/var/lib/mysql"
|
||||
- "./ext/mysql.conf.d:/etc/mysql/conf.d"
|
||||
environment:
|
||||
- MYSQL_DATABASE=ensl
|
||||
- MYSQL_USER=ensl
|
||||
- MYSQL_USERNAME=ensl
|
||||
- MYSQL_PASSWORD=ensl
|
||||
- MYSQL_ROOT_PASSWORD=ensl
|
||||
- MYSQL_ROOT_HOST=%
|
||||
memcached:
|
||||
image: memcached:latest
|
||||
#redis:
|
||||
# image: redis
|
Loading…
Reference in a new issue