-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
23 lines (19 loc) · 1.01 KB
/
Dockerfile
File metadata and controls
23 lines (19 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# hadolint global ignore=DL3008
# NOTE: this dockerfile is primarilty for local development only
# it's primary purpose is to emulate heroku-buildpack-nginx's
# functionality that compiles config/nginx.conf.erb
# See https://github.com/heroku/heroku-buildpack-nginx/blob/fefac6c569f28182b3459cb8e34b8ccafc403fde/bin/start-nginx
FROM nginx:1.29.6
# Logs are configured to a relatic path under /etc/nginx
# but the container expects /var/log
RUN mkdir -p /etc/nginx/logs && ln -sf /var/log/nginx /etc/nginx/logs/
# erb unfortunately needs a whole ruby install
RUN apt-get update && apt-get install -y --no-install-recommends ruby && rm -rf /var/lib/apt/lists/*
# this gets run automatically by the nginx container's entrypoint
COPY 20-compile-nginx-conf-erb.sh /docker-entrypoint.d
# NOTE: this removes the args "-g daemon off" because nginx is impolite
# and treats a cli flag and a config flag as duplicate:
#
# nginx: [emerg] "daemon" directive is duplicate in /etc/nginx/nginx.conf:3
#
CMD ["nginx"]