Skip to content

Commit e95c9ae

Browse files
author
gptkong
committed
immer-docs
1 parent 47be558 commit e95c9ae

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

immer-docs/Dockerfile

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Use nginx as the base image
2+
FROM nginx:alpine
3+
4+
# Install git
5+
RUN apk add --no-cache git
6+
7+
# Create a directory for the documentation
8+
WORKDIR /usr/share/nginx/html
9+
10+
# Clone the repository and checkout gh-pages branch
11+
RUN git clone https://github.com/immerjs/immer.git /tmp/immer && \
12+
cd /tmp/immer && \
13+
git checkout gh-pages && \
14+
cp -r ./* ./.??* /usr/share/nginx/html/ && \
15+
rm -rf /tmp/immer
16+
17+
# Create custom nginx configuration
18+
RUN echo 'server { \
19+
listen 80; \
20+
server_name localhost; \
21+
root /usr/share/nginx/html; \
22+
index index.html; \
23+
location / { \
24+
try_files $uri $uri/ /index.html; \
25+
} \
26+
location /immer/ { \
27+
alias /usr/share/nginx/html/; \
28+
try_files $uri $uri/ /index.html; \
29+
} \
30+
}' > /etc/nginx/conf.d/default.conf
31+
32+
# Expose port 80
33+
EXPOSE 80
34+
35+
# Start Nginx
36+
CMD ["nginx", "-g", "daemon off;"]

0 commit comments

Comments
 (0)