Spaces:
Running
Running
Merge pull request #4 from andreped/fix-docker-permissions
Browse files- Dockerfile +11 -10
- nginx.conf +2 -1
Dockerfile
CHANGED
|
@@ -1,10 +1,7 @@
|
|
| 1 |
FROM nginx:alpine
|
| 2 |
|
| 3 |
-
# Install
|
| 4 |
-
RUN apk add --no-cache shadow
|
| 5 |
-
|
| 6 |
-
# Install wget
|
| 7 |
-
RUN apk add --no-cache wget
|
| 8 |
|
| 9 |
# Add a new user
|
| 10 |
RUN useradd -m -u 1000 user
|
|
@@ -16,20 +13,24 @@ WORKDIR /app
|
|
| 16 |
COPY index.html /usr/share/nginx/html
|
| 17 |
COPY nginx.conf /etc/nginx/nginx.conf
|
| 18 |
|
| 19 |
-
# Download test data
|
| 20 |
RUN wget https://github.com/andreped/wsi-visualization-demo/releases/download/sample-data/test-sample.zip \
|
| 21 |
&& unzip test-sample.zip -d /usr/share/nginx/html \
|
| 22 |
&& rm test-sample.zip
|
| 23 |
|
| 24 |
-
# Download OpenSeadragon
|
| 25 |
RUN wget https://github.com/openseadragon/openseadragon/releases/download/v5.0.0/openseadragon-bin-5.0.0.zip \
|
| 26 |
&& unzip openseadragon-bin-5.0.0.zip -d /usr/share/nginx/html \
|
| 27 |
&& rm openseadragon-bin-5.0.0.zip
|
| 28 |
|
| 29 |
-
|
|
|
|
| 30 |
|
| 31 |
# Expose port 7860
|
| 32 |
EXPOSE 7860
|
| 33 |
|
| 34 |
-
#
|
| 35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
FROM nginx:alpine
|
| 2 |
|
| 3 |
+
# Install necessary packages
|
| 4 |
+
RUN apk add --no-cache shadow wget unzip
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
# Add a new user
|
| 7 |
RUN useradd -m -u 1000 user
|
|
|
|
| 13 |
COPY index.html /usr/share/nginx/html
|
| 14 |
COPY nginx.conf /etc/nginx/nginx.conf
|
| 15 |
|
| 16 |
+
# Download and uncompress test data
|
| 17 |
RUN wget https://github.com/andreped/wsi-visualization-demo/releases/download/sample-data/test-sample.zip \
|
| 18 |
&& unzip test-sample.zip -d /usr/share/nginx/html \
|
| 19 |
&& rm test-sample.zip
|
| 20 |
|
| 21 |
+
# Download and uncompress OpenSeadragon
|
| 22 |
RUN wget https://github.com/openseadragon/openseadragon/releases/download/v5.0.0/openseadragon-bin-5.0.0.zip \
|
| 23 |
&& unzip openseadragon-bin-5.0.0.zip -d /usr/share/nginx/html \
|
| 24 |
&& rm openseadragon-bin-5.0.0.zip
|
| 25 |
|
| 26 |
+
# Change ownership of nginx directories to the new user
|
| 27 |
+
RUN chown -R user:user /var/cache/nginx /var/run /var/log/nginx /usr/share/nginx/html
|
| 28 |
|
| 29 |
# Expose port 7860
|
| 30 |
EXPOSE 7860
|
| 31 |
|
| 32 |
+
# Switch to the new user
|
| 33 |
+
USER user
|
| 34 |
+
|
| 35 |
+
# Start nginx
|
| 36 |
+
CMD ["nginx", "-g", "daemon off;"]
|
nginx.conf
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
-
|
|
|
|
| 2 |
events {
|
| 3 |
worker_connections 1024;
|
| 4 |
}
|
|
|
|
| 1 |
+
pid /tmp/nginx.pid;
|
| 2 |
+
|
| 3 |
events {
|
| 4 |
worker_connections 1024;
|
| 5 |
}
|