No description
Find a file
Joe Doss aa49cb1cfe
Bugfix for #7663 and refactor of container setup (#7747)
* Move from Alpine Linux to Fedora Linux.

This changes the base container image away from Alpine Linux to
Fedora Linux to address some musl libc issues with some of our gems.

It also moved the main file to a Containerfile and symlinks the Dockerfile
to it. This makes our container setup less Docker-centric as Linux users
most likely will be using Podman as their container runtime.

Lastly, it moves the WORKDIR from /usr/src/app to /opt/apps/devto.
The Linux FHS states that /opt is the spot for Optional application
software packages and /usr/src is for kernel source code.

https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard

/opt Optional application software packages
/usr/src Source code, e.g., the kernel source code with its header files.

Also, if SELinux becomes a thing in our future, moving this makes it
easier to manage contexts out of /opt rather than /usr/src.

* Adjust the Containerfile a bit to add some missing packages, make it
more generic and move env vars to the docker-compose.

* Move the Dockerfile to a symlink to the Containerfile.

We need to be able to support more than just Docker for a container
runtime. Moving everything to a Containerfile and symlinking the
Dockerfile helps users run runtimes such as Podman.

* Add in new entrypoint files and fix the app path in docker-entrypoint.sh

* Refactor the docker-compose.yml file so it doesn't build the main
application container three times in a row. We can use the same
container for web, webpacker, and sidekiq.

Also make the volume names very explicit on what their contents and add
in SELinux context support with :Z

* Fix ELASTICSEARCH_URL.

* Remove the absolute path on ip binary and add in iproute to Containerfile.

* Symlink the Dockerfile to Containerfile and add in a container-compose.yml file
for usage with podman-compose. We are waiting for this issue to get resolved

https://github.com/containers/libpod/issues/6153

and for podman-compose to mature a bit more. A user using podman-compose can use

podman-compose -f container-compose.yml

to launch the DEV container stack with Podman.

* Update the .gitignore file to reflect the new container volumes.

* Fix the entrypoint script on the Containerfile and clean up a bunch of things.

* Rework the Containerfile to prep it to run as a non-root user. We have to wait
for this issue to get fixed:

https://github.com/containers/libpod/issues/6153

for Linux users and then we can uncomment the USER line so we are running Rails
as a non-root user. :toot:

* This reworks the compose files so each task that is needed to start the app has
a correct wait command with dockerize. It also adds in containers for doing
yarn and bundle things for development. Since we mount the code directory inside
the container we lose our pre-containerized gems and node_modules.

This means users can run:

Linux
podman-compose -f container-compose.yml up

Mac
docker-compose up

and it should correctly build the app stack with containers!

* Clean up old container related things.

* Add in some container pre-reqs and my name to the "Core team" section! :toot:

* Adjust the seed and sidekiq compose entries so they do not use the web entrypoint
and set the REDIS_URL and REDIS_SESSIONS_URL env vars for seed.

Add in some echos to the entrypoint.sh.

Also set docker-compose to use :delegated on mount points to speed things up.

https://docs.docker.com/storage/bind-mounts/#configure-mount-consistency-for-macos

* Just call yarn install --dev on the yarn container.

* Update documentation to support Docker and Podman as Container Engines and
move the page from docker to containers to reflect the fact not all users run
their containers via Docker.

There are dozens of us... DOZENS!

* Set --local on bundle config so it just impacts this Ruby app.

* Renamed bin/docker-setup to bin/container-setup to reflect the fact that that
we can use Podman as a container engine. I also refactored it so it does some
basic pre-flight checks for docker and docker-compose or podman and
podman-compose to make sure users have a container engine installed.

* Set cache_all_platforms true for bundler.

* Bump docker-compose dockerize -timeout to 45min for slower macOS hardware.

* Move to the consolidated app_initializer:setup rake task for bootstrapping the
app.

* Update docs/installation/readme.md
2020-05-28 12:11:51 -05:00
.gems Bugfix for #7663 and refactor of container setup (#7747) 2020-05-28 12:11:51 -05:00
.github Implement sentence construction changes on PR template (#7588) 2020-04-29 09:39:13 -04:00
.vscode Add nickytonline.dev-to-extension-pack to VSCode recommendations (#6437) 2020-03-04 14:22:28 -05:00
.yarn/releases Update yarn version (#6857) 2020-03-26 18:08:49 -04:00
app Update the tag moderation email (#8048) 2020-05-28 17:46:41 +02:00
bin Bugfix for #7663 and refactor of container setup (#7747) 2020-05-28 12:11:51 -05:00
config Bugfix for #7663 and refactor of container setup (#7747) 2020-05-28 12:11:51 -05:00
datadog [deploy] dont configure Honeycomb if its disabled (#6618) 2020-05-11 11:59:18 -05:00
db Add download_app Welcome Notification (#8067) 2020-05-27 08:14:47 -06:00
docs Bugfix for #7663 and refactor of container setup (#7747) 2020-05-28 12:11:51 -05:00
lib [deploy] Consolidate Setup Tasks to a Single Rake Task (#8065) 2020-05-27 11:59:07 -05:00
log Initial commit 2018-02-28 16:11:08 -05:00
public [deploy] Revert generalization of meta content in offline.html (#7232) 2020-04-10 21:45:49 -04:00
scripts Bugfix for #7663 and refactor of container setup (#7747) 2020-05-28 12:11:51 -05:00
spec Update the tag moderation email (#8048) 2020-05-28 17:46:41 +02:00
vendor Add libv8 for Catalina (#8106) 2020-05-28 11:31:32 +02:00
.codeclimate.yml Loosen CodeClimate's method-lines rule (#7980) 2020-05-20 16:44:35 +02:00
.dockerignore #4129 Reduce Dockerfile size (#4251) 2019-10-10 18:01:04 -04:00
.editorconfig Export articles/posts (#576) 2018-11-21 11:13:36 -05:00
.erb-lint.yml [deploy] Remove Unused Pro Memberships (#7894) 2020-05-20 11:54:30 -05:00
.eslintignore Add app/assets/javascripts/lib to eslintignore (#4323) [ci skip] 2019-10-08 18:38:59 -04:00
.eslintrc.js Bump to sprockets 4.0.0 (#6172) [deploy] 2020-02-24 18:16:08 -05:00
.gitattributes Topbar icons states (#7012) 2020-04-02 11:50:05 +02:00
.gitdocs.js Create DelayedJob config and misc DX changes (#979) 2018-10-26 13:15:14 -04:00
.gitignore Bugfix for #7663 and refactor of container setup (#7747) 2020-05-28 12:11:51 -05:00
.gitpod.dockerfile Upgrade Ruby to 2.7.1 (#7097) [deploy] 2020-04-06 18:21:50 +02:00
.gitpod.yml [deploy] Remove ALL Algolia Code (#7577) 2020-04-29 10:11:57 -05:00
.nvmrc [deploy] Lock node to 12.16 (#8057) 2020-05-26 10:36:50 -05:00
.postcssrc.yml Initial commit 2018-02-28 16:11:08 -05:00
.prettierignore Use yarn 1.21.1 (#5786) 2020-02-05 17:04:06 -05:00
.rspec Initial commit 2018-02-28 16:11:08 -05:00
.rubocop.yml Routine rubocop fixes (#8028) 2020-05-22 14:42:40 -04:00
.rubocop_todo.yml Routine rubocop fixes (#8028) 2020-05-22 14:42:40 -04:00
.ruby-version Upgrade Ruby to 2.7.1 (#7097) [deploy] 2020-04-06 18:21:50 +02:00
.simplecov Update .simplecov (#8078) 2020-05-27 14:37:21 -04:00
.slugignore Add .slugignore (#6528) 2020-03-10 14:43:48 -04:00
.travis.yml Add Percy to Travis yml (#7970) [deploy] 2020-05-20 13:50:22 -07:00
.validaterc Validate API OpenAPI 3 spec (#6519) 2020-03-09 16:40:05 +01:00
.yardopts Adds Ruby source code documentation to docs.dev.to (#2656) 2019-05-02 13:50:58 -04:00
.yarnrc Update yarn version (#6857) 2020-03-26 18:08:49 -04:00
babel.config.js [deploy] Update webpacker configuration (#8004) 2020-05-25 12:03:18 -04:00
CODE_OF_CONDUCT.md Replace ban/banned with suspend/suspended in user facing text (#5816) [deploy] 2020-02-10 10:12:53 -05:00
config.ru Remove honeycomb code from config.ru (#2378) 2019-04-11 11:58:13 -04:00
container-compose.yml Bugfix for #7663 and refactor of container setup (#7747) 2020-05-28 12:11:51 -05:00
Containerfile Bugfix for #7663 and refactor of container setup (#7747) 2020-05-28 12:11:51 -05:00
CONTRIBUTING.md Fix dev.to link (#8097) 2020-05-28 10:00:47 +02:00
docker-compose.yml Bugfix for #7663 and refactor of container setup (#7747) 2020-05-28 12:11:51 -05:00
Dockerfile Bugfix for #7663 and refactor of container setup (#7747) 2020-05-28 12:11:51 -05:00
empty-module.js Initial commit 2018-02-28 16:11:08 -05:00
Envfile [deploy] Decouple Twitter authentication from fetching tweets (#7920) 2020-05-19 18:05:41 -04:00
Gemfile Bump rubocop-performance from 1.5.2 to 1.6.0 (#8116) 2020-05-28 10:38:16 -05:00
Gemfile.lock Bump rubocop-performance from 1.5.2 to 1.6.0 (#8116) 2020-05-28 10:38:16 -05:00
Guardfile Remove controller specs (#2224) 2019-03-29 19:05:02 -04:00
jest.config.js Fixed issue with jest picking up the built storybook folder causing tests to run out of memory. (#8096) 2020-05-28 14:22:24 +02:00
jsconfig.json Request Utility for Frontend (#7317) 2020-04-22 07:58:15 -04:00
LICENSE.md Ran all markdown files through prettier to fix a handful. (#4599) 2019-10-28 08:20:53 -04:00
package.json Configured jest to use the jest-watch-typeahead watch plugin. (#8093) 2020-05-28 10:09:50 +02:00
Procfile remove rake jobs:work references from code (#6082) [deploy] 2020-02-14 15:18:08 -05:00
Procfile.dev Adapt dev env to use remote box (#7742) 2020-05-13 10:21:00 -04:00
Procfile.dev-hot Initial commit 2018-02-28 16:11:08 -05:00
Rakefile Code cleanups (#659) 2018-08-07 11:00:13 -04:00
README.md Bugfix for #7663 and refactor of container setup (#7747) 2020-05-28 12:11:51 -05:00
release-tasks.sh [deploy] Consolidate Setup Tasks to a Single Rake Task (#8065) 2020-05-27 11:59:07 -05:00
yarn.lock Configured jest to use the jest-watch-typeahead watch plugin. (#8093) 2020-05-28 10:09:50 +02:00


DEV

DEV Community 👩‍💻👨‍💻

The Human Layer of the Stack

ruby version rails version Travis Status for thepracticaldev/dev.to Code Climate maintainability Code Climate test coverage Code Climate technical debt CodeTriage badge Dependabot Badge GitPod badge Netlify badge GitHub code size in bytes GitHub commit activity GitHub issues ready for dev Honeybadger badge

Welcome to the dev.to codebase. We are so excited to have you. With your help, we can build out DEV to be more stable and better serve our community.

What is dev.to?

dev.to (or just DEV) is a platform where software developers write articles, take part in discussions, and build their professional profiles. We value supportive and constructive dialogue in the pursuit of great code and career growth for all members. The ecosystem spans from beginner to advanced developers, and all are welcome to find their place within our community. ❤️

Table of Contents

Contributing

We encourage you to contribute to dev.to! Please check out the Contributing to dev.to guide for guidelines about how to proceed.

Getting Started

This section provides a high-level quick start guide. If you're looking for the installation guide, you'll want to refer to our complete Developer Documentation.

We run on a Rails backend, and we are currently transitioning to a Preact-first frontend.

A more complete overview of our stack is available in our docs.

Prerequisites

Local

Containers

Linux

OS X

Installation Documentation

View Full Installation Documentation.

Developer Documentation

Check out our dedicated docs page for more technical documentation.

Core team

Vulnerability disclosure

We welcome security research on DEV under the terms of our vulnerability disclosure policy.

License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Please see the LICENSE file in our repository for the full text.

Like many open source projects, we require that contributors provide us with a Contributor License Agreement (CLA). By submitting code to the DEV project, you are granting us a right to use that code under the terms of the CLA.

Our version of the CLA was adapted from the Microsoft Contributor License Agreement, which they generously made available to the public domain under Creative Commons CC0 1.0 Universal.

Any questions, please refer to our license FAQ doc or email yo@dev.to.


Sloan, the sloth mascot
Happy Coding ❤️