File size: 1,046 Bytes
95e0c4c
 
05a0049
 
f4224ab
93613c3
95e0c4c
 
93613c3
95e0c4c
 
93613c3
95e0c4c
 
 
05a0049
f4224ab
 
 
 
05a0049
f4224ab
 
 
 
05a0049
 
f4224ab
93613c3
95e0c4c
 
05a0049
 
 
 
 
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
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;"]