generated from cheqd/.github
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
45 lines (33 loc) · 1.12 KB
/
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
###############################################################
### STAGE 1: Build custom Nginx runner ###
###############################################################
FROM nginx:alpine-slim as runner
# Install pre-requisites
RUN apk update && \
apk add --no-cache bash ca-certificates
# Set working directory
WORKDIR /etc/nginx
# Set shell to bash
SHELL ["/bin/bash", "-euo", "pipefail", "-c"]
# Copy top-level Nginx configuration
COPY nginx.conf ./nginx.conf
# Copy shared configurations
COPY common/ ./conf.d/
# Copy site-level configurations
COPY sites/ ./templates/
# Copy entrypoint script
COPY entrypoint.sh /etc/nginx/entrypoint.sh
# Change ownership of the Nginx files/directories to the nginx user
RUN touch /var/run/nginx.pid && \
mkdir -p /etc/nginx/sites-enabled && \
chown -R nginx:nginx /var/run/nginx.pid /var/cache/nginx /etc/nginx && \
chmod +x /etc/nginx/entrypoint.sh
# Set environment variables
ENV API_ENDPOINT=api.logto.dev
ENV API_PORT=3001
ENV ADMIN_ENDPOINT=admin.logto.dev
ENV ADMIN_PORT=3002
# Set user
USER nginx
# Start Nginx in the foreground
CMD ["/etc/nginx/entrypoint.sh"]