Skip to content
Snippets Groups Projects
Commit c3f97a77 authored by Rysev, Gleb (UG - SISC)'s avatar Rysev, Gleb (UG - SISC)
Browse files

More docker

parent d828df4e
No related branches found
No related tags found
Loading
Pipeline #30484 failed
NODE_ENV=development
RAILS_ENV=development
WEBPACKER_DEV_SERVER_HOST=0.0.0.0
...@@ -6,18 +6,21 @@ FROM ruby:2.5.7 ...@@ -6,18 +6,21 @@ FROM ruby:2.5.7
RUN mkdir -p /usr/src/app RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app WORKDIR /usr/src/app
EXPOSE 3000
CMD ["rails", "server", "-b", "0.0.0.0"]
RUN apt-get update && apt-get install -y nodejs --no-install-recommends && rm -rf /var/lib/apt/lists/* RUN apt-get update && apt-get install -y nodejs --no-install-recommends && rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y default-mysql-client postgresql-client sqlite3 --no-install-recommends && rm -rf /var/lib/apt/lists/* RUN apt-get update && apt-get install -y default-mysql-client postgresql-client sqlite3 yarn --no-install-recommends && rm -rf /var/lib/apt/lists/*
#RUN gem install bundler -v 1.17.3 #RUN gem install bundler -v 1.17.3
COPY Gemfile /usr/src/app/ COPY Gemfile /usr/src/app/
# Uncomment the line below if Gemfile.lock is maintained outside of build process # Uncomment the line below if Gemfile.lock is maintained outside of build process
COPY Gemfile.lock /usr/src/app/ COPY Gemfile.lock /usr/src/app/
RUN bundle install RUN bundle install
COPY . /usr/src/app COPY . /usr/src/app
# COPY entrypoint.sh /usr/bin/
# RUN chmod +x /usr/bin/entrypoint.sh
# ENTRYPOINT ["entrypoint.sh"]
EXPOSE 3000
CMD ["rails", "server", "-b", "0.0.0.0"]
version: "3" version: '3'
services: services:
db: webpacker:
image: postgres build: .
env_file:
- '.env.docker'
command: ./bin/webpack-dev-server
volumes: volumes:
- ./tmp/db:/var/lib/postgresql/data - .:/app
environment: ports:
POSTGRES_PASSWORD: password - '3035:3035'
web: web:
build: . build: .
command: bash -c "rm -f tmp/pids/server.pid && bundle exec rails s -p 3000 -b '0.0.0.0'" command: bash -c "rm -f tmp/pids/server.pid && bundle exec rails s -p 3000 -b '0.0.0.0'"
volumes: volumes:
- .:/myapp - .:/app
ports: ports:
- "3000:3000" - "3000:3000"
depends_on:
- db
#!/bin/sh
set -e
# Remove a potentially pre-existing server.pid for Rails.
rm -f /myapp/tmp/pids/server.pid
# Then exec the container's main process (what's set as CMD in the Dockerfile).
exec "$@"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment