-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
36 lines (26 loc) · 1.02 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
FROM nginx:alpine
# Install necessary packages
RUN apk add --no-cache shadow wget unzip
# Add a new user
RUN useradd -m -u 1000 user
# Set the working directory
WORKDIR /app
# Copy the HTML and nginx configuration files
COPY index.html /usr/share/nginx/html
COPY nginx.conf /etc/nginx/nginx.conf
# Download and uncompress test data
RUN wget https://github.com/andreped/wsi-visualization-demo/releases/download/sample-data/test-sample.zip \
&& unzip test-sample.zip -d /usr/share/nginx/html \
&& rm test-sample.zip
# Download and uncompress OpenSeadragon
RUN wget https://github.com/openseadragon/openseadragon/releases/download/v5.0.0/openseadragon-bin-5.0.0.zip \
&& unzip openseadragon-bin-5.0.0.zip -d /usr/share/nginx/html \
&& rm openseadragon-bin-5.0.0.zip
# Change ownership of nginx directories to the new user
RUN chown -R user:user /var/cache/nginx /var/run /var/log/nginx /usr/share/nginx/html
# Expose port 7860
EXPOSE 7860
# Switch to the new user
USER user
# Start nginx
CMD ["nginx", "-g", "daemon off;"]