nginx
Browse files- Dockerfile +7 -10
- README.md +1 -1
- nginx.conf +11 -0
Dockerfile
CHANGED
|
@@ -20,17 +20,14 @@ RUN npm run build
|
|
| 20 |
# Use an official Nginx runtime as the base image for serving the application
|
| 21 |
FROM nginx:alpine
|
| 22 |
|
| 23 |
-
# Set up a new user named "user" with user ID 1000
|
| 24 |
-
RUN addgroup -S user && adduser -S user -G user
|
| 25 |
-
|
| 26 |
-
# Switch to the "user" user
|
| 27 |
-
USER user
|
| 28 |
-
|
| 29 |
# Copy the built application from the build stage
|
| 30 |
-
COPY --
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
-
# Expose
|
| 33 |
-
EXPOSE
|
| 34 |
|
| 35 |
# Command to run the application
|
| 36 |
-
CMD ["nginx", "-g", "daemon off;"]
|
|
|
|
| 20 |
# Use an official Nginx runtime as the base image for serving the application
|
| 21 |
FROM nginx:alpine
|
| 22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
# Copy the built application from the build stage
|
| 24 |
+
COPY --from=build /app/dist /usr/share/nginx/html
|
| 25 |
+
|
| 26 |
+
# Copy a custom Nginx configuration file
|
| 27 |
+
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
| 28 |
|
| 29 |
+
# Expose port 8080
|
| 30 |
+
EXPOSE 8080
|
| 31 |
|
| 32 |
# Command to run the application
|
| 33 |
+
CMD ["nginx", "-g", "daemon off;"]
|
README.md
CHANGED
|
@@ -6,6 +6,6 @@ colorTo: indigo
|
|
| 6 |
sdk: docker
|
| 7 |
pinned: false
|
| 8 |
header: mini
|
| 9 |
-
app_port:
|
| 10 |
thumbnail: https://huggingface.co/spaces/HuggingFaceFW/blogpost-fineweb-v1/resolve/main/screenshot.jpeg
|
| 11 |
---
|
|
|
|
| 6 |
sdk: docker
|
| 7 |
pinned: false
|
| 8 |
header: mini
|
| 9 |
+
app_port: 8080
|
| 10 |
thumbnail: https://huggingface.co/spaces/HuggingFaceFW/blogpost-fineweb-v1/resolve/main/screenshot.jpeg
|
| 11 |
---
|
nginx.conf
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
server {
|
| 2 |
+
listen 8080;
|
| 3 |
+
server_name localhost;
|
| 4 |
+
|
| 5 |
+
root /usr/share/nginx/html;
|
| 6 |
+
index index.html;
|
| 7 |
+
|
| 8 |
+
location / {
|
| 9 |
+
try_files $uri $uri/ /index.html;
|
| 10 |
+
}
|
| 11 |
+
}
|