-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
48 lines (29 loc) · 975 Bytes
/
Dockerfile
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
ARG KONG_BASE=kong:2.5.0-alpine
FROM ${KONG_BASE} AS build
ARG PLUGINS
ENV INJECTED_PLUGINS=${PLUGINS}
ARG TEMPLATE=empty_file
ENV TEMPLATE=${TEMPLATE}
ARG ROCKS_DIR=empty_file
ENV ROCKS_DIR=${ROCKS_DIR}
ARG KONG_LICENSE_DATA
ENV KONG_LICENSE_DATA=${KONG_LICENSE_DATA}
COPY $TEMPLATE /plugins/custom_nginx.conf
COPY $ROCKS_DIR /rocks-server
COPY packer.lua /packer.lua
USER root
RUN /usr/local/openresty/luajit/bin/luajit /packer.lua -- "$INJECTED_PLUGINS"
FROM ${KONG_BASE}
USER root
# Install Google Cloud SQL Proxy
RUN apk add --no-cache \
ca-certificates \
wget \
&& wget https://dl.google.com/cloudsql/cloud_sql_proxy.linux.amd64 -O /usr/bin/cloud_sql_proxy \
&& chmod +x /usr/bin/cloud_sql_proxy
# Rename/Whitelabel default response headers (renames "Kong" to "Gateway")
RUN sed -i s/"X-Kong/"X-Gateway/g /usr/local/share/lua/5.1/kong/constants.lua
COPY --from=build /plugins /plugins
USER root
RUN /plugins/install_plugins.sh
USER kong