-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Peter Solymos <psolymos@gmail.com>
- Loading branch information
Showing
2 changed files
with
56 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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Define the parent image | ||
FROM rhub/r-minimal:4.4.1 | ||
|
||
# Install dependencies | ||
# -d install C and C++ compilers, temporarily | ||
# -t install Alpine packages, temporarily | ||
# -a install Alpine packages and keep them | ||
RUN installr -d \ | ||
-t "zlib-dev cairo-dev" \ | ||
-a "cairo font-liberation" \ | ||
Cairo \ | ||
shiny | ||
|
||
# Add non-root user and group | ||
RUN addgroup --system app && \ | ||
adduser --system --ingroup app app | ||
|
||
# Set working directory to home of the non-root user | ||
WORKDIR /home/app | ||
|
||
# Copy Shiny app files | ||
COPY app . | ||
|
||
# Set owner for the home folder | ||
RUN chown app:app -R /home/app | ||
|
||
# Set user to non-root | ||
USER app | ||
|
||
# Expose port | ||
EXPOSE 3838 | ||
|
||
# Set command to execute at runtime | ||
CMD ["R", "-e", "shiny::runApp(host='0.0.0.0', port=3838)"] |
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