Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

### dev

FROM ruby:${RUBY_VERSION}-slim as dev

Check warning on line 7 in Dockerfile

View workflow job for this annotation

GitHub Actions / Build containers

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG ruby:${RUBY_VERSION}-slim results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/
ARG NODE_VERSION

USER root
Expand Down Expand Up @@ -34,9 +34,9 @@

FROM dev AS build

ENV RAILS_ENV production

Check warning on line 37 in Dockerfile

View workflow job for this annotation

GitHub Actions / Build containers

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/
ENV NODE_ENV production

Check warning on line 38 in Dockerfile

View workflow job for this annotation

GitHub Actions / Build containers

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/
ENV AWS_ACCESS_KEY_ID dummy

Check warning on line 39 in Dockerfile

View workflow job for this annotation

GitHub Actions / Build containers

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "AWS_ACCESS_KEY_ID") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/

Check warning on line 39 in Dockerfile

View workflow job for this annotation

GitHub Actions / Build containers

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/
ENV AWS_SECRET_ACCESS_KEY dummy

RUN bundle exec bootsnap precompile --gemfile app/ lib/
Expand All @@ -45,21 +45,21 @@

### ld_preload trickery

FROM ruby:${RUBY_VERSION}-slim as amd64_jemalloc

Check warning on line 48 in Dockerfile

View workflow job for this annotation

GitHub Actions / Build containers

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG ruby:${RUBY_VERSION}-slim results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/

Check warning on line 48 in Dockerfile

View workflow job for this annotation

GitHub Actions / Build containers

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/
ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2

FROM ruby:${RUBY_VERSION}-slim as arm64_jemalloc

Check warning on line 51 in Dockerfile

View workflow job for this annotation

GitHub Actions / Build containers

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/
ENV LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libjemalloc.so.2

### production

FROM ${TARGETARCH}_jemalloc as production

Check warning on line 56 in Dockerfile

View workflow job for this annotation

GitHub Actions / Build containers

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/
ARG NODE_VERSION
ARG TARGETARCH
ARG REVISION
ARG CHAMBER_VERSION

ENV RAILS_ENV production

Check warning on line 62 in Dockerfile

View workflow job for this annotation

GitHub Actions / Build containers

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/
ENV NODE_ENV production
ENV REVISION ${REVISION}

Expand All @@ -72,7 +72,7 @@
# shared-mime-info: Rails dependency
# libpq5: pg gem dependency
# mariadb-client: dependency for Intercode 1 import
RUN apt-get update && apt-get install -y --no-install-recommends openssh-server iproute2 curl python3 libvips42 poppler-utils xz-utils libjemalloc2 shared-mime-info libpq5 mariadb-client && rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y --no-install-recommends openssh-server iproute2 curl python3 libvips42 poppler-utils xz-utils libjemalloc2 shared-mime-info libpq5 mariadb-client gosu && rm -rf /var/lib/apt/lists/*
RUN useradd -ms $(which bash) www
RUN mkdir /opt/node && \
cd /opt/node && \
Expand Down
5 changes: 1 addition & 4 deletions bin/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
#!/bin/bash
set -e

# Drop to the www user while preserving the current environment (needed so
# AWS_ROLE_ARN / AWS_WEB_IDENTITY_TOKEN_FILE are visible to the app process).
# If already running as www (e.g. in tests), just exec directly.
drop_to_www() {
if [ "$(id -u)" -eq 0 ]; then
exec su -s /bin/bash --preserve-environment -c 'exec "$0" "$@"' www "$@"
exec gosu www "$@"
else
exec "$@"
fi
Expand Down
2 changes: 1 addition & 1 deletion fly.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ console_command = "/usr/src/intercode/bin/entrypoint.sh /bin/bash"
image = "ghcr.io/neinteractiveliterature/intercode:latest"

[deploy]
release_command = "bundle exec rails release:perform --trace"
release_command = "bundle exec rails release:perform"
strategy = "bluegreen"

[env]
Expand Down
Loading