Skip to content

Commit 7bc09a6

Browse files
committed
examples: thin Dockerfiles that rely on the base
1 parent 7cbce25 commit 7bc09a6

2 files changed

Lines changed: 22 additions & 18 deletions

File tree

examples/light-service.Dockerfile

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
11
# syntax=docker/dockerfile:1.7
22
#
3-
# Example for a lighter service using only the slim core base
3+
# Example for a Canis service using only the slim core base
4+
# (e.g. events, levriero, sashimi, volpino — after Ruby 4)
5+
# Base already provides: passenger/nginx, app_env, ntp, root SSH, guarded shoryuken
46

5-
FROM ghcr.io/datacite/canis-base:v1.2.3
7+
FROM ghcr.io/datacite/canis-base:1.2.3
68

79
LABEL maintainer="support@datacite.org"
810

9-
# Add only what is unique to your service here
11+
# Service-only packages (examples)
12+
# RUN apt-get update && apt-get install -y --no-install-recommends \
13+
# default-libmysqlclient-dev imagemagick && \
14+
# apt-get clean && rm -rf /var/lib/apt/lists/*
15+
1016
COPY vendor/docker/webapp.conf /etc/nginx/sites-enabled/webapp.conf
11-
COPY vendor/docker/00_app_env.conf /etc/nginx/conf.d/00_app_env.conf
1217

13-
RUN mkdir -p /etc/service/shoryuken
14-
COPY vendor/docker/shoryuken.sh /etc/service/shoryuken/run
18+
# Optional: enable migrations on boot (kept in the app, not the base)
19+
# COPY vendor/docker/90_migrate.sh /etc/my_init.d/90_migrate.sh
1520

16-
COPY vendor/docker/10_ssh.sh /etc/my_init.d/10_ssh.sh
17-
COPY vendor/docker/90_migrate.sh /etc/my_init.d/90_migrate.sh
21+
# Optional: override base shoryuken/ssh/app_env only if this service differs
22+
# COPY vendor/docker/shoryuken.sh /etc/service/shoryuken/run
1823

1924
COPY . /home/app/webapp/
2025
RUN mkdir -p tmp/pids tmp/storage && \

examples/lupo.Dockerfile

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
# syntax=docker/dockerfile:1.7
22
#
33
# Example Lupo Dockerfile using canis-base-tools
4+
# Base already provides: passenger/nginx, app_env, ntp, root SSH, guarded shoryuken
45

5-
FROM ghcr.io/datacite/canis-base-tools:v1.2.3
6+
FROM ghcr.io/datacite/canis-base-tools:1.2.3
67

78
LABEL maintainer="support@datacite.org"
89

910
ENV NGINX_ENVSUBST_OUTPUT_DIR=/etc/nginx/sites-enabled
1011

12+
# Lupo-only packages (not in the shared base)
13+
RUN apt-get update && \
14+
apt-get install -y --no-install-recommends \
15+
default-libmysqlclient-dev imagemagick gettext && \
16+
apt-get clean && rm -rf /var/lib/apt/lists/*
17+
1118
# Lupo-specific nginx configuration
1219
COPY vendor/docker/webapp.conf.template /etc/nginx/templates/webapp.conf.template
1320
COPY vendor/docker/70_nginx_templates.sh /etc/my_init.d/70_nginx_templates.sh
@@ -16,14 +23,7 @@ COPY vendor/docker/70_nginx_templates.sh /etc/my_init.d/70_nginx_templates.sh
1623
RUN mkdir -p /etc/service/passenger-metrics
1724
COPY vendor/docker/passenger-metrics-run.sh /etc/service/passenger-metrics/run
1825

19-
# Standard service and startup scripts
20-
COPY vendor/docker/00_app_env.conf /etc/nginx/conf.d/00_app_env.conf
21-
COPY vendor/docker/ntp.conf /etc/ntp.conf
22-
23-
RUN mkdir -p /etc/service/shoryuken
24-
COPY vendor/docker/shoryuken.sh /etc/service/shoryuken/run
25-
26-
COPY vendor/docker/10_ssh.sh /etc/my_init.d/10_ssh.sh
26+
# Migrations stay in the app (not in the base)
2727
COPY vendor/docker/90_migrate.sh /etc/my_init.d/90_migrate.sh
2828

2929
# Application code
@@ -32,7 +32,6 @@ RUN mkdir -p tmp/pids tmp/storage && \
3232
chown -R app:app /home/app/webapp && \
3333
chmod -R 755 /home/app/webapp
3434

35-
# Install gems
3635
WORKDIR /home/app/webapp
3736
RUN mkdir -p vendor/bundle && \
3837
chown -R app:app . && \

0 commit comments

Comments
 (0)