-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
35 lines (29 loc) · 967 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
FROM nginx:stable-alpine
COPY packages/web/dist/spa /app
RUN apk --no-cache add nginx
RUN echo ' \
server { \
listen 80 default_server; \
root /app; \
\
location / { \
add_header Cache-Control "no-store"; \
try_files $uri $uri/index.html /index.html; \
} \
\
location /api/ { \
proxy_pass http://devbox-server:8080; \
proxy_set_header Host $http_host; \
proxy_set_header X-real-ip $remote_addr; \
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; \
proxy_http_version 1.1; \
proxy_set_header Upgrade $http_upgrade; \
proxy_set_header Connection $http_connection; \
proxy_set_header Accept-Encoding gzip; \
proxy_read_timeout 180; \
} \
\
}' > /etc/nginx/conf.d/default.conf
RUN ln -sf /dev/stdout /var/log/nginx/access.log && ln -sf /dev/stderr /var/log/nginx/error.log
EXPOSE 80
CMD [ "nginx", "-g", "daemon off;" ]