forked from WordPress/openverse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.nginx
33 lines (27 loc) · 1.44 KB
/
Dockerfile.nginx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Keeping this as a separate Dockerfile prevents the need to rely on additional
# contexts required for the frontend build (namely, `repo_root`). These are
# possible with compose as of https://github.com/docker/compose/pull/10369
# and do appear to work, but it increases the complexity and these features
# are not yet all available in every containerd implementation or distribution
# (Debian, for example, still distributes an older version of compose without
# this new feature). For the sake of keeping the local setup simpler and not
# requiring contributors to have bleeding-edge Docker and compose plugin versions,
# we can simply use a separate file for the time being. Once/if we start to use
# nginx to serve static files for the frontend, we will need to integrate this
# target into the shared Dockerfile.
#########
# NGINX #
#########
FROM docker.io/nginx:1.27.3-alpine AS nginx
LABEL org.opencontainers.image.source="https://github.com/WordPress/openverse"
WORKDIR /app
RUN mkdir -p /data/nginx/cache
COPY nginx/nginx.conf.template /etc/nginx/templates/openverse-frontend.conf.template
COPY nginx/snippets /etc/nginx/snippets
# Only environment variables with this prefix will be available in the template
ENV NGINX_ENVSUBST_FILTER="OPENVERSE_NGINX_"
ENV OPENVERSE_NGINX_ENVIRONMENT="local"
# Add the release version to the docker container
ARG SEMANTIC_VERSION
ENV OPENVERSE_NGINX_GIT_REVISION=$SEMANTIC_VERSION
ENV OPENVERSE_NGINX_LISTEN_PORT="8080"