This repository has been archived by the owner on Jun 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(webapp oci):initial version of webapp image
- Loading branch information
Showing
5 changed files
with
80 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ config.yaml | |
results | ||
venv | ||
mgc | ||
./nginx.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Set number of worker processes automatically based on number of CPU cores. | ||
worker_processes auto; | ||
|
||
events { | ||
# The maximum number of simultaneous connections that can be opened by | ||
# a worker process. | ||
worker_connections 1024; | ||
} | ||
|
||
http { | ||
server { | ||
listen {{ .webapp.nginx.listen }}; | ||
server_name {{ .webapp.nginx.server_name }}; | ||
|
||
{{- range $location_name, $location := .webapp.nginx.locations}} | ||
location {{ $location_name }} { | ||
root {{ $location.root }}; | ||
index index.html; | ||
autoindex on; | ||
} | ||
{{- end}} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Use main image as base | ||
FROM ghcr.io/marmotitude/object-storage-tests:main | ||
|
||
# Install Nginx | ||
RUN apk update && \ | ||
apk add nginx | ||
|
||
# Keep a backup of alpine's default nginx config | ||
RUN mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf.orig | ||
|
||
# Copy our custom Nginx configuration | ||
COPY nginx.conf /etc/nginx/nginx.conf | ||
|
||
# Set the working directory to /app | ||
WORKDIR /app | ||
|
||
# Create the directory for the results | ||
RUN mkdir -p results | ||
|
||
# Set ownership and permissions for Nginx to read from /app/results | ||
RUN chown -R root:root results && \ | ||
chmod -R 755 results | ||
|
||
# Write dummy file to results directory with a smile and timestamp | ||
RUN printf ":-)\n\nBuilded on $(date) by:$(hostname)" > results/smile.txt | ||
|
||
# Copy the shell script that runs desired tests outputing to results folder | ||
# this script will be executed by an external scheduler periodically | ||
# TBD | ||
|
||
# Expose port 5000 | ||
EXPOSE 5000 | ||
|
||
# Override the main image's entry point and set the default command | ||
ENTRYPOINT ["nginx", "-g", "daemon off;"] | ||
CMD [] |