Update containers: DEV => Forem (#9611)

This PR moves the away from the dev specific naming to forem w/r/t container
things. Also moves to the Forem quay.io org.

* Move to Forem from DEV
* Add in assets and packs directories.
This commit is contained in:
Joe Doss 2020-08-03 16:54:45 -05:00 committed by GitHub
parent e9bbcbb789
commit 3e0a40741e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 88 additions and 92 deletions

View file

@ -1,18 +1,18 @@
FROM quay.io/devto/ruby:2.7.1
FROM quay.io/forem/ruby:2.7.1
USER root
RUN curl -sL https://dl.yarnpkg.com/rpm/yarn.repo -o /etc/yum.repos.d/yarn.repo && \
dnf install -y bash git ImageMagick iproute less libcurl libcurl-devel \
dnf install -y bash curl git ImageMagick iproute less libcurl libcurl-devel \
libffi-devel libxml2-devel libxslt-devel nodejs pcre-devel \
postgresql postgresql-devel ruby-devel tzdata yarn \
&& dnf -y clean all \
&& rm -rf /var/cache/yum
ENV APP_USER=devto
ENV APP_USER=forem
ENV APP_UID=1000
ENV APP_GID=1000
ENV APP_HOME=/opt/apps/devto/
ENV APP_HOME=/opt/apps/forem/
RUN mkdir -p ${APP_HOME} && chown "${APP_UID}":"${APP_GID}" "${APP_HOME}"
RUN groupadd -g "${APP_GID}" "${APP_USER}" && \
adduser -u "${APP_UID}" -g "${APP_GID}" -d "${APP_HOME}" "${APP_USER}"
@ -31,11 +31,7 @@ RUN wget https://github.com/jwilder/dockerize/releases/download/"${DOCKERIZE_VER
WORKDIR "${APP_HOME}"
# As soon as this:
# https://github.com/containers/libpod/issues/6153
# issue is fixed for Linux users we can uncomment the line below so we are not
# running the app as the root user. :toot:
# USER "${APP_USER}"
USER "${APP_USER}"
COPY ./.ruby-version "${APP_HOME}"
COPY ./Gemfile ./Gemfile.lock "${APP_HOME}"
@ -49,7 +45,7 @@ COPY ./package.json ./yarn.lock ./.yarnrc "${APP_HOME}"
COPY ./.yarn "${APP_HOME}"/.yarn
RUN yarn install
RUN mkdir -p "${APP_HOME}"/public/{uploads,images,podcasts}
RUN mkdir -p "${APP_HOME}"/public/{assets,images,packs,podcasts,uploads}
COPY . "${APP_HOME}"

View file

@ -64,7 +64,7 @@ else
fi
echo "Building the DEV container image!"
echo "Building the Forem container image!"
if [ "${CONTAINER_RUNTIME}" = "docker" ]; then
echo "This will take a while if you are building the container for the first time."
@ -73,11 +73,11 @@ if [ "${CONTAINER_RUNTIME}" = "docker" ]; then
elif [ "${CONTAINER_RUNTIME}" = "podman" ]; then
podman-compose build
podman-compose -f container-compose.yml build
fi
echo "Starting the DEV container stack..."
echo "Starting the Forem container stack..."
if [ "${CONTAINER_RUNTIME}" = "docker" ]; then
@ -93,14 +93,14 @@ if [ "${CONTAINER_RUNTIME}" = "docker" ]; then
elif [ "${CONTAINER_RUNTIME}" = "podman" ]; then
if podman pod exists devto; then
echo "The devto pod is already setup. Please run:"
if podman pod exists forem; then
echo "The forem pod is already setup. Please run:"
echo ""
echo "podman-compose -p devto -f container-compose.yml down"
echo "podman-compose -p forem -f container-compose.yml down"
echo ""
echo "to bring down the DEV container stack before running container-setup."
echo "to bring down the Forem container stack before running container-setup."
else
podman-compose -p devto -f container-compose.yml up
podman-compose -p forem -f container-compose.yml up
fi
fi

View file

@ -1,9 +1,9 @@
version: "3"
services:
web:
rails:
build: .
image: devto-web:latest
container_name: dev_web
image: forem-rails:latest
container_name: forem_rails
ports:
- "3000:3000"
depends_on:
@ -14,7 +14,7 @@ services:
- yarn
environment:
RAILS_ENV: development
DATABASE_URL: postgresql://devto:devto@db:5432/PracticalDeveloper_development
DATABASE_URL: postgresql://forem:forem@db:5432/PracticalDeveloper_development
ELASTICSEARCH_URL: http://elasticsearch:9200
REDIS_URL: redis://redis:6379
REDIS_SESSIONS_URL: redis://redis:6379
@ -22,60 +22,60 @@ services:
RACK_TIMEOUT_SERVICE_TIMEOUT: 10000
STATEMENT_TIMEOUT: 10000
volumes:
- .:/opt/apps/devto:z
- .:/opt/apps/forem:z
- ./.gems:/opt/apps/bundle:z
entrypoint: ["dockerize", "-wait", "tcp://db:5432", "-wait", "http://elasticsearch:9200", "-wait", "tcp://redis:6379", "-wait", "file:///opt/apps/bundle/bundle_finished", "-timeout", "300s", "./scripts/entrypoint.sh"]
command: ["bundle", "exec", "rails","server","-b","0.0.0.0","-p","3000"]
bundle:
image: devto-web:latest
container_name: dev_bundle
image: forem-rails:latest
container_name: forem_bundle
environment:
RAILS_ENV: development
REDIS_SIDEKIQ_URL: redis://redis:6379
DATABASE_URL: postgresql://devto:devto@db:5432/PracticalDeveloper_development
DATABASE_URL: postgresql://forem:forem@db:5432/PracticalDeveloper_development
ELASTICSEARCH_URL: http://elasticsearch:9200
volumes:
- .:/opt/apps/devto:z
- .:/opt/apps/forem:z
- ./.gems:/opt/apps/bundle:z
entrypoint: ["bash"]
command: ["./scripts/bundle.sh"]
yarn:
image: devto-web:latest
container_name: dev_yarn
image: forem-rails:latest
container_name: forem_yarn
environment:
RAILS_ENV: development
REDIS_SIDEKIQ_URL: redis://redis:6379
DATABASE_URL: postgresql://devto:devto@db:5432/PracticalDeveloper_development
DATABASE_URL: postgresql://forem:forem@db:5432/PracticalDeveloper_development
ELASTICSEARCH_URL: http://elasticsearch:9200
volumes:
- .:/opt/apps/devto:z
- .:/opt/apps/forem:z
entrypoint: ["bash", "-c"]
command: ["yarn install --dev"]
webpacker:
image: devto-web:latest
container_name: dev_webpacker
image: forem-rails:latest
container_name: forem_webpacker
depends_on:
- web
- rails
- yarn
environment:
RAILS_ENV: development
REDIS_SIDEKIQ_URL: redis://redis:6379
DATABASE_URL: postgresql://devto:devto@db:5432/PracticalDeveloper_development
DATABASE_URL: postgresql://forem:forem@db:5432/PracticalDeveloper_development
ELASTICSEARCH_URL: http://elasticsearch:9200
volumes:
- .:/opt/apps/devto:z
- .:/opt/apps/forem:z
- ./.gems:/opt/apps/bundle:z
entrypoint: ["dockerize", "-wait", "file:///opt/apps/devto/node_modules/.bin/webpack-dev-server", "-timeout", "300s"]
entrypoint: ["dockerize", "-wait", "file:///opt/apps/forem/node_modules/.bin/webpack-dev-server", "-timeout", "300s"]
command: ["./bin/webpack-dev-server"]
seed:
image: devto-web:latest
container_name: dev_seed
image: forem-rails:latest
container_name: forem_seed
depends_on:
- web
- rails
- redis
- db
- elasticsearch
@ -84,39 +84,39 @@ services:
REDIS_SIDEKIQ_URL: redis://redis:6379
REDIS_URL: redis://redis:6379
REDIS_SESSIONS_URL: redis://redis:6379
DATABASE_URL: postgresql://devto:devto@db:5432/PracticalDeveloper_development
DATABASE_URL: postgresql://forem:forem@db:5432/PracticalDeveloper_development
ELASTICSEARCH_URL: http://elasticsearch:9200
volumes:
- .:/opt/apps/devto:z
- .:/opt/apps/forem:z
- ./.gems:/opt/apps/bundle:z
entrypoint: ["dockerize", "-wait", "tcp://db:5432", "-wait", "http://elasticsearch:9200", "-wait", "tcp://redis:6379", "-wait", "http://web:3000", "-timeout", "300s"]
entrypoint: ["dockerize", "-wait", "tcp://db:5432", "-wait", "http://elasticsearch:9200", "-wait", "tcp://redis:6379", "-wait", "http://rails:3000", "-timeout", "300s"]
command: ["bundle", "exec", "rake","db:seed"]
sidekiq:
image: devto-web:latest
container_name: dev_sidekiq
image: forem-rails:latest
container_name: forem_sidekiq
depends_on:
- web
- rails
- redis
- db
- elasticsearch
environment:
RAILS_ENV: development
REDIS_SIDEKIQ_URL: redis://redis:6379
DATABASE_URL: postgresql://devto:devto@db:5432/PracticalDeveloper_development
DATABASE_URL: postgresql://forem:forem@db:5432/PracticalDeveloper_development
ELASTICSEARCH_URL: http://elasticsearch:9200
volumes:
- .:/opt/apps/devto:z
- .:/opt/apps/forem:z
- ./.gems:/opt/apps/bundle:z
entrypoint: ["dockerize", "-wait", "tcp://db:5432", "-wait", "http://elasticsearch:9200", "-wait", "tcp://redis:6379", "-wait", "http://web:3000", "-timeout", "300s"]
entrypoint: ["dockerize", "-wait", "tcp://db:5432", "-wait", "http://elasticsearch:9200", "-wait", "tcp://redis:6379", "-wait", "http://rails:3000", "-timeout", "300s"]
command: ["bundle", "exec", "sidekiq","-c","2"]
db:
image: postgres:11-alpine
container_name: dev_postgresql
container_name: forem_postgresql
environment:
POSTGRES_USER: devto
POSTGRES_PASSWORD: devto
POSTGRES_USER: forem
POSTGRES_PASSWORD: forem
POSTGRES_DB: PracticalDeveloper_development
ports:
- "5432:5432"
@ -125,15 +125,15 @@ services:
redis:
image: "redis"
container_name: dev_redis
container_name: forem_redis
ports:
- "6379:6379"
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.5.2
container_name: dev_elasticsearch
container_name: forem_elasticsearch
environment:
- cluster.name=devto
- cluster.name=forem
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- "discovery.type=single-node"

View file

@ -1,9 +1,9 @@
version: "3"
services:
web:
rails:
build: .
image: devto-web:latest
container_name: dev_web
image: forem-rails:latest
container_name: forem_rails
ports:
- "3000:3000"
depends_on:
@ -14,7 +14,7 @@ services:
- yarn
environment:
RAILS_ENV: development
DATABASE_URL: postgresql://devto:devto@db:5432/PracticalDeveloper_development
DATABASE_URL: postgresql://forem:forem@db:5432/PracticalDeveloper_development
ELASTICSEARCH_URL: http://elasticsearch:9200
REDIS_URL: redis://redis:6379
REDIS_SESSIONS_URL: redis://redis:6379
@ -22,60 +22,60 @@ services:
RACK_TIMEOUT_SERVICE_TIMEOUT: 10000
STATEMENT_TIMEOUT: 10000
volumes:
- .:/opt/apps/devto:delegated
- .:/opt/apps/forem:delegated
- ./.gems:/opt/apps/bundle:delegated
entrypoint: ["dockerize", "-wait", "tcp://db:5432", "-wait", "http://elasticsearch:9200", "-wait", "tcp://redis:6379", "-wait", "file:///opt/apps/bundle/bundle_finished", "-timeout", "2700s", "./scripts/entrypoint.sh"]
command: ["bundle", "exec", "rails","server","-b","0.0.0.0","-p","3000"]
bundle:
image: devto-web:latest
container_name: dev_bundle
image: forem-rails:latest
container_name: forem_bundle
environment:
RAILS_ENV: development
REDIS_SIDEKIQ_URL: redis://redis:6379
DATABASE_URL: postgresql://devto:devto@db:5432/PracticalDeveloper_development
DATABASE_URL: postgresql://forem:forem@db:5432/PracticalDeveloper_development
ELASTICSEARCH_URL: http://elasticsearch:9200
volumes:
- .:/opt/apps/devto:delegated
- .:/opt/apps/forem:delegated
- ./.gems:/opt/apps/bundle:delegated
entrypoint: ["bash"]
command: ["./scripts/bundle.sh"]
yarn:
image: devto-web:latest
container_name: dev_yarn
image: forem-rails:latest
container_name: forem_yarn
environment:
RAILS_ENV: development
REDIS_SIDEKIQ_URL: redis://redis:6379
DATABASE_URL: postgresql://devto:devto@db:5432/PracticalDeveloper_development
DATABASE_URL: postgresql://forem:forem@db:5432/PracticalDeveloper_development
ELASTICSEARCH_URL: http://elasticsearch:9200
volumes:
- .:/opt/apps/devto:delegated
- .:/opt/apps/forem:delegated
entrypoint: ["bash", "-c"]
command: ["yarn install --dev"]
webpacker:
image: devto-web:latest
container_name: dev_webpacker
image: forem-rails:latest
container_name: forem_webpacker
depends_on:
- web
- rails
- yarn
environment:
RAILS_ENV: development
REDIS_SIDEKIQ_URL: redis://redis:6379
DATABASE_URL: postgresql://devto:devto@db:5432/PracticalDeveloper_development
DATABASE_URL: postgresql://forem:forem@db:5432/PracticalDeveloper_development
ELASTICSEARCH_URL: http://elasticsearch:9200
volumes:
- .:/opt/apps/devto:delegated
- .:/opt/apps/forem:delegated
- ./.gems:/opt/apps/bundle:delegated
entrypoint: ["dockerize", "-wait", "file:///opt/apps/devto/node_modules/.bin/webpack-dev-server", "-timeout", "2700s"]
entrypoint: ["dockerize", "-wait", "file:///opt/apps/forem/node_modules/.bin/webpack-dev-server", "-timeout", "2700s"]
command: ["./bin/webpack-dev-server"]
seed:
image: devto-web:latest
container_name: dev_seed
image: forem-rails:latest
container_name: forem_seed
depends_on:
- web
- rails
- redis
- db
- elasticsearch
@ -84,39 +84,39 @@ services:
REDIS_SIDEKIQ_URL: redis://redis:6379
REDIS_URL: redis://redis:6379
REDIS_SESSIONS_URL: redis://redis:6379
DATABASE_URL: postgresql://devto:devto@db:5432/PracticalDeveloper_development
DATABASE_URL: postgresql://forem:forem@db:5432/PracticalDeveloper_development
ELASTICSEARCH_URL: http://elasticsearch:9200
volumes:
- .:/opt/apps/devto:delegated
- .:/opt/apps/forem:delegated
- ./.gems:/opt/apps/bundle:delegated
entrypoint: ["dockerize", "-wait", "tcp://db:5432", "-wait", "http://elasticsearch:9200", "-wait", "tcp://redis:6379", "-wait", "http://web:3000", "-timeout", "2700s"]
entrypoint: ["dockerize", "-wait", "tcp://db:5432", "-wait", "http://elasticsearch:9200", "-wait", "tcp://redis:6379", "-wait", "http://rails:3000", "-timeout", "2700s"]
command: ["bundle", "exec", "rake","db:seed"]
sidekiq:
image: devto-web:latest
container_name: dev_sidekiq
image: forem-rails:latest
container_name: forem_sidekiq
depends_on:
- web
- rails
- redis
- db
- elasticsearch
environment:
RAILS_ENV: development
REDIS_SIDEKIQ_URL: redis://redis:6379
DATABASE_URL: postgresql://devto:devto@db:5432/PracticalDeveloper_development
DATABASE_URL: postgresql://forem:forem@db:5432/PracticalDeveloper_development
ELASTICSEARCH_URL: http://elasticsearch:9200
volumes:
- .:/opt/apps/devto:delegated
- .:/opt/apps/forem:delegated
- ./.gems:/opt/apps/bundle:delegated
entrypoint: ["dockerize", "-wait", "tcp://db:5432", "-wait", "http://elasticsearch:9200", "-wait", "tcp://redis:6379", "-wait", "http://web:3000", "-timeout", "2700s"]
entrypoint: ["dockerize", "-wait", "tcp://db:5432", "-wait", "http://elasticsearch:9200", "-wait", "tcp://redis:6379", "-wait", "http://rails:3000", "-timeout", "2700s"]
command: ["bundle", "exec", "sidekiq","-c","2"]
db:
image: postgres:11-alpine
container_name: dev_postgresql
container_name: forem_postgresql
environment:
POSTGRES_USER: devto
POSTGRES_PASSWORD: devto
POSTGRES_USER: forem
POSTGRES_PASSWORD: forem
POSTGRES_DB: PracticalDeveloper_development
ports:
- "5432:5432"
@ -125,15 +125,15 @@ services:
redis:
image: "redis"
container_name: dev_redis
container_name: forem_redis
ports:
- "6379:6379"
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.5.2
container_name: dev_elasticsearch
container_name: forem_elasticsearch
environment:
- cluster.name=devto
- cluster.name=forem
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- "discovery.type=single-node"